{
  "openapi": "3.1.1",
  "info": {
    "title": "Binacle.Net API v4",
    "description": "Binacle.Net answers which box an order goes in, and whether it fits, in milliseconds.\n\n**Warning: This API version is experimental and may change any time, introducing breaking changes.**\n\n\n\n[View on Github](https://github.com/binacle-labs/Binacle.Net)\n\n[🐳 Binacle.Net on Dockerhub](https://hub.docker.com/r/binacle/binacle-net)\n\n",
    "contact": {
      "name": "Binacle.Net",
      "url": "https://github.com/binacle-labs/Binacle.Net"
    },
    "license": {
      "name": "GNU Affero General Public License v3.0",
      "url": "https://www.gnu.org/licenses/agpl-3.0.html"
    },
    "version": "4.0"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/api/v4/presets/{preset}": {
      "get": {
        "tags": [
          "Presets"
        ],
        "summary": "Get a preset",
        "description": "Gets the bins configured for a single preset.",
        "operationId": "presets.get",
        "parameters": [
          {
            "name": "preset",
            "in": "path",
            "description": "Name of the preset to use.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the preset with its associated bins.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresetResponse"
                },
                "example": {
                  "name": "preset1",
                  "bins": [
                    {
                      "id": "preset1_bin1",
                      "length": 10,
                      "width": 10,
                      "height": 10
                    },
                    {
                      "id": "preset1_bin2",
                      "length": 20,
                      "width": 20,
                      "height": 20
                    },
                    {
                      "id": "preset1_bin3",
                      "length": 30,
                      "width": 30,
                      "height": 30
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Not Found. If the preset does not exist."
          }
        }
      }
    },
    "/api/v4/presets": {
      "get": {
        "tags": [
          "Presets"
        ],
        "summary": "List presets",
        "description": "Lists the presets present in configuration.",
        "operationId": "presets.list",
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns all of the configured presets with the associated bins.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresetListResponse"
                },
                "example": {
                  "presets": {
                    "preset1": [
                      {
                        "id": "preset1_bin1",
                        "length": 10,
                        "width": 10,
                        "height": 10
                      },
                      {
                        "id": "preset1_bin2",
                        "length": 20,
                        "width": 20,
                        "height": 20
                      },
                      {
                        "id": "preset1_bin3",
                        "length": 30,
                        "width": 30,
                        "height": 30
                      }
                    ],
                    "preset2": [
                      {
                        "id": "preset2_bin1",
                        "length": 10,
                        "width": 20,
                        "height": 30
                      },
                      {
                        "id": "preset2_bin2",
                        "length": 30,
                        "width": 60,
                        "height": 60
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/pack/best-bin": {
      "post": {
        "tags": [
          "Pack"
        ],
        "summary": "Pack the best custom bin",
        "description": "Pack every custom bin and return the result for the bin the items fill the most.",
        "operationId": "pack.customBestBin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackCustomBestBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "bins": [
                  {
                    "id": "custom_bin_1",
                    "length": 10,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_2",
                    "length": 20,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_3",
                    "length": 30,
                    "width": 40,
                    "height": 60
                  }
                ],
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the packing operation for the custom bin with the highest utilization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackBinResponse"
                },
                "examples": {
                  "fullyPackedResponse": {
                    "summary": "Fully Packed Response",
                    "description": "Example response for the bin whose volume the items fill the most.",
                    "value": {
                      "status": "FullyPacked",
                      "bin": {
                        "id": "custom_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                    }
                  },
                  "partiallyPackedResponse": {
                    "summary": "Partially Packed Response",
                    "description": "Example response when no bin fits every item, so the one the items fill the most is returned.",
                    "value": {
                      "status": "PartiallyPacked",
                      "bin": {
                        "id": "custom_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA=="
                    }
                  },
                  "unpackedResponse": {
                    "summary": "Unpacked Response",
                    "description": "Example response when none of the bins can fit the items.",
                    "value": {
                      "status": "NotPacked",
                      "bin": {
                        "id": "custom_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [ ],
                      "unpackedItems": [
                        {
                          "id": "box_2",
                          "quantity": 1
                        },
                        {
                          "id": "box_3",
                          "quantity": 1
                        },
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 0,
                      "packedBinVolumePercentage": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidBinData": {
                    "summary": "Invalid Bin Data",
                    "description": "Example response when you provide invalid Bin data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Bins": [
                          "IDs in `Bins` must be unique"
                        ],
                        "Bins[0].Length": [
                          "'Length' must be greater than '0'."
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/pack/bin": {
      "post": {
        "tags": [
          "Pack"
        ],
        "summary": "Pack a custom bin",
        "description": "Pack items into a custom bin.",
        "operationId": "pack.customBin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackCustomBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "bin": {
                  "id": "custom_bin",
                  "length": 10,
                  "width": 40,
                  "height": 60
                },
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the packing operation for the specified custom bin and items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackBinResponse"
                },
                "examples": {
                  "fullyPackedResponse": {
                    "summary": "Fully Packed Response",
                    "description": "Example response when all items fit into the bin and no items are left unpacked.",
                    "value": {
                      "status": "FullyPacked",
                      "bin": {
                        "id": "custom_bin",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                    }
                  },
                  "partiallyPackedResponse": {
                    "summary": "Partially Packed Response",
                    "description": "Example response when some items fit into the bin but some items are left unpacked",
                    "value": {
                      "status": "PartiallyPacked",
                      "bin": {
                        "id": "custom_bin",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA=="
                    }
                  },
                  "unpackedResponse": {
                    "summary": "Unpacked Response",
                    "description": "Example response when no items fit into the bin and all items are left unpacked",
                    "value": {
                      "status": "NotPacked",
                      "bin": {
                        "id": "custom_bin",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [ ],
                      "unpackedItems": [
                        {
                          "id": "box_2",
                          "quantity": 1
                        },
                        {
                          "id": "box_3",
                          "quantity": 1
                        },
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 0,
                      "packedBinVolumePercentage": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidBinData": {
                    "summary": "Invalid Bin Data",
                    "description": "Example response when you provide invalid Bin data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Bin.Length": [
                          "'Length' must be greater than '0'."
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/pack/compare-bins": {
      "post": {
        "tags": [
          "Pack"
        ],
        "summary": "Compare custom bins",
        "description": "Pack every custom bin and return the result for each one.",
        "operationId": "pack.customCompareBins",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackCustomCompareRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "bins": [
                  {
                    "id": "custom_bin_1",
                    "length": 10,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_2",
                    "length": 20,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_3",
                    "length": 30,
                    "width": 40,
                    "height": 60
                  }
                ],
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the packing operation for every custom bin, in the order they were sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackCompareResponse"
                },
                "examples": {
                  "compareResponse": {
                    "summary": "Compare Response",
                    "description": "Example response with one result per requested bin, in the order the bins were sent.",
                    "value": {
                      "results": [
                        {
                          "status": "FullyPacked",
                          "bin": {
                            "id": "custom_bin_1",
                            "length": 10,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 15.83,
                          "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                        },
                        {
                          "status": "FullyPacked",
                          "bin": {
                            "id": "custom_bin_2",
                            "length": 20,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 7.92,
                          "viPaqData": "AAAEABQoPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                        },
                        {
                          "status": "FullyPacked",
                          "bin": {
                            "id": "custom_bin_3",
                            "length": 30,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 5.28,
                          "viPaqData": "AAAEAB4oPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidBinData": {
                    "summary": "Invalid Bin Data",
                    "description": "Example response when you provide invalid Bin data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Bins": [
                          "IDs in `Bins` must be unique"
                        ],
                        "Bins[0].Length": [
                          "'Length' must be greater than '0'."
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/pack/smallest-bin": {
      "post": {
        "tags": [
          "Pack"
        ],
        "summary": "Pack the smallest custom bin",
        "description": "Pack every custom bin and return the result for the smallest bin that can fit the items.",
        "operationId": "pack.customSmallestBin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackCustomSmallestBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "bins": [
                  {
                    "id": "custom_bin_1",
                    "length": 10,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_2",
                    "length": 20,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_3",
                    "length": 30,
                    "width": 40,
                    "height": 60
                  }
                ],
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the packing operation for the smallest custom bin that can fit the items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackBinResponse"
                },
                "examples": {
                  "fullyPackedResponse": {
                    "summary": "Fully Packed Response",
                    "description": "Example response when all items fit into the bin and no items are left unpacked.",
                    "value": {
                      "status": "FullyPacked",
                      "bin": {
                        "id": "custom_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                    }
                  },
                  "partiallyPackedResponse": {
                    "summary": "Partially Packed Response",
                    "description": "Example response when some items fit into the bin but some items are left unpacked",
                    "value": {
                      "status": "PartiallyPacked",
                      "bin": {
                        "id": "custom_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA=="
                    }
                  },
                  "unpackedResponse": {
                    "summary": "Unpacked Response",
                    "description": "Example response when no items fit into the bin and all items are left unpacked",
                    "value": {
                      "status": "NotPacked",
                      "bin": {
                        "id": "custom_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [ ],
                      "unpackedItems": [
                        {
                          "id": "box_2",
                          "quantity": 1
                        },
                        {
                          "id": "box_3",
                          "quantity": 1
                        },
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 0,
                      "packedBinVolumePercentage": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidBinData": {
                    "summary": "Invalid Bin Data",
                    "description": "Example response when you provide invalid Bin data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Bins": [
                          "IDs in `Bins` must be unique"
                        ],
                        "Bins[0].Length": [
                          "'Length' must be greater than '0'."
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/pack/best-bin/{preset}": {
      "post": {
        "tags": [
          "Pack"
        ],
        "summary": "Pack the best bin in a preset",
        "description": "Pack every bin in a preset and return the result for the bin the items fill the most.",
        "operationId": "pack.presetBestBin",
        "parameters": [
          {
            "name": "preset",
            "in": "path",
            "description": "Name of the preset to use.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackPresetBestBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the packing operation for the bin in the preset with the highest utilization.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackBinResponse"
                },
                "examples": {
                  "fullyPackedResponse": {
                    "summary": "Fully Packed Response",
                    "description": "Example response for the bin in the preset whose volume the items fill the most.",
                    "value": {
                      "status": "FullyPacked",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                    }
                  },
                  "partiallyPackedResponse": {
                    "summary": "Partially Packed Response",
                    "description": "Example response when no bin in the preset fits every item, so the one the items fill the most is returned.",
                    "value": {
                      "status": "PartiallyPacked",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA=="
                    }
                  },
                  "unpackedResponse": {
                    "summary": "Unpacked Response",
                    "description": "Example response when no bin in the preset can fit the items.",
                    "value": {
                      "status": "NotPacked",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [ ],
                      "unpackedItems": [
                        {
                          "id": "box_2",
                          "quantity": 1
                        },
                        {
                          "id": "box_3",
                          "quantity": 1
                        },
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 0,
                      "packedBinVolumePercentage": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found. If the preset does not exist."
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/pack/bin/{preset}/{bin}": {
      "post": {
        "tags": [
          "Pack"
        ],
        "summary": "Pack a bin from a preset",
        "description": "Pack items into a bin from a preset. The preset and bin must be specified in the URL path.",
        "operationId": "pack.presetBin",
        "parameters": [
          {
            "name": "preset",
            "in": "path",
            "description": "Name of the preset to use.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bin",
            "in": "path",
            "description": "Identifier of the bin within the preset.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackPresetBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the packing operation for the specified bin and items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackBinResponse"
                },
                "examples": {
                  "fullyPackedResponse": {
                    "summary": "Fully Packed Response",
                    "description": "Example response when all items fit into the bin and no items are left unpacked.",
                    "value": {
                      "status": "FullyPacked",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                    }
                  },
                  "partiallyPackedResponse": {
                    "summary": "Partially Packed Response",
                    "description": "Example response when some items fit into the bin but some items are left unpacked",
                    "value": {
                      "status": "PartiallyPacked",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA=="
                    }
                  },
                  "unpackedResponse": {
                    "summary": "Unpacked Response",
                    "description": "Example response when no items fit into the bin and all items are left unpacked",
                    "value": {
                      "status": "NotPacked",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [ ],
                      "unpackedItems": [
                        {
                          "id": "box_2",
                          "quantity": 1
                        },
                        {
                          "id": "box_3",
                          "quantity": 1
                        },
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 0,
                      "packedBinVolumePercentage": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found. If the preset or the bin in the specified preset does not exist."
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/pack/compare-bins/{preset}": {
      "post": {
        "tags": [
          "Pack"
        ],
        "summary": "Compare the bins in a preset",
        "description": "Pack every bin in a preset and return the result for each one.",
        "operationId": "pack.presetCompareBins",
        "parameters": [
          {
            "name": "preset",
            "in": "path",
            "description": "Name of the preset to use.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackPresetCompareRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the packing operation for every bin in the preset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackCompareResponse"
                },
                "examples": {
                  "compareResponse": {
                    "summary": "Compare Response",
                    "description": "Example response with one result per bin in the preset, in the order the preset defines them.",
                    "value": {
                      "results": [
                        {
                          "status": "FullyPacked",
                          "bin": {
                            "id": "preset_bin_1",
                            "length": 10,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 15.83,
                          "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                        },
                        {
                          "status": "FullyPacked",
                          "bin": {
                            "id": "preset_bin_2",
                            "length": 20,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 7.92,
                          "viPaqData": "AAAEABQoPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                        },
                        {
                          "status": "FullyPacked",
                          "bin": {
                            "id": "preset_bin_3",
                            "length": 30,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 5.28,
                          "viPaqData": "AAAEAB4oPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found. If the preset does not exist."
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/pack/smallest-bin/{preset}": {
      "post": {
        "tags": [
          "Pack"
        ],
        "summary": "Pack the smallest bin in a preset",
        "description": "Pack every bin in a preset and return the result for the smallest bin that can fit the items.",
        "operationId": "pack.presetSmallestBin",
        "parameters": [
          {
            "name": "preset",
            "in": "path",
            "description": "Name of the preset to use.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PackPresetSmallestBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the packing operation for the smallest bin in the preset that can fit the items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PackBinResponse"
                },
                "examples": {
                  "fullyPackedResponse": {
                    "summary": "Fully Packed Response",
                    "description": "Example response when all items fit into the smallest bin of the preset.",
                    "value": {
                      "status": "FullyPacked",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA=="
                    }
                  },
                  "partiallyPackedResponse": {
                    "summary": "Partially Packed Response",
                    "description": "Example response when some items fit into the bin but some items are left unpacked",
                    "value": {
                      "status": "PartiallyPacked",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA=="
                    }
                  },
                  "unpackedResponse": {
                    "summary": "Unpacked Response",
                    "description": "Example response when no bin in the preset can fit the items.",
                    "value": {
                      "status": "NotPacked",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [ ],
                      "unpackedItems": [
                        {
                          "id": "box_2",
                          "quantity": 1
                        },
                        {
                          "id": "box_3",
                          "quantity": 1
                        },
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 0,
                      "packedBinVolumePercentage": 0
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found. If the preset does not exist."
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/fit/bin": {
      "post": {
        "tags": [
          "Fit"
        ],
        "summary": "Fit a custom bin",
        "description": "Attempt to find if all items fit into a custom bin.",
        "operationId": "fit.customBin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FitCustomBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "bin": {
                  "id": "custom_bin",
                  "length": 10,
                  "width": 40,
                  "height": 60
                },
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the fitting operation for the specified custom bin and items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FitBinResponse"
                },
                "examples": {
                  "fitResponse": {
                    "summary": "Fit Response",
                    "description": "Example response when all items fit into the bin and no items are left unpacked.",
                    "value": {
                      "status": "Fits",
                      "bin": {
                        "id": "custom_bin",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                      "earlyExitReason": "None"
                    }
                  },
                  "doesNotFitResponse": {
                    "summary": "Does Not Fit Response",
                    "description": "Example response when some items don't fit into the bin.",
                    "value": {
                      "status": "DoesNotFit",
                      "bin": {
                        "id": "custom_bin",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA==",
                      "earlyExitReason": "None"
                    }
                  },
                  "earlyExitResponse": {
                    "summary": "Early Exit Response",
                    "description": "Example response when the early exit condition is met and the algorithm exits before starting.",
                    "value": {
                      "status": "EarlyExit",
                      "bin": {
                        "id": "custom_bin",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [ ],
                      "unpackedItems": [
                        {
                          "id": "large_box",
                          "quantity": 1
                        }
                      ],
                      "packedItemsVolumePercentage": 0,
                      "packedBinVolumePercentage": 0,
                      "earlyExitReason": "ContainerDimensionExceeded"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidBinData": {
                    "summary": "Invalid Bin Data",
                    "description": "Example response when you provide invalid Bin data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Bin.Length": [
                          "'Length' must be greater than '0'."
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/fit/compare-bins": {
      "post": {
        "tags": [
          "Fit"
        ],
        "summary": "Compare custom bins",
        "description": "Fit-check every custom bin and return the result for each one.",
        "operationId": "fit.customCompareBins",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FitCustomCompareRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "bins": [
                  {
                    "id": "custom_bin_1",
                    "length": 10,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_2",
                    "length": 20,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_3",
                    "length": 30,
                    "width": 40,
                    "height": 60
                  }
                ],
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the fitting operation for every custom bin, in the order they were sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FitCompareResponse"
                },
                "examples": {
                  "compareResponse": {
                    "summary": "Compare Response",
                    "description": "Example response with one result per requested bin, in the order the bins were sent.",
                    "value": {
                      "results": [
                        {
                          "status": "Fits",
                          "bin": {
                            "id": "custom_bin_1",
                            "length": 10,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 15.83,
                          "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                          "earlyExitReason": "None"
                        },
                        {
                          "status": "Fits",
                          "bin": {
                            "id": "custom_bin_2",
                            "length": 20,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 7.92,
                          "viPaqData": "AAAEABQoPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                          "earlyExitReason": "None"
                        },
                        {
                          "status": "Fits",
                          "bin": {
                            "id": "custom_bin_3",
                            "length": 30,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 5.28,
                          "viPaqData": "AAAEAB4oPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                          "earlyExitReason": "None"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidBinData": {
                    "summary": "Invalid Bin Data",
                    "description": "Example response when you provide invalid Bin data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Bins": [
                          "IDs in `Bins` must be unique"
                        ],
                        "Bins[0].Length": [
                          "'Length' must be greater than '0'."
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/fit/smallest-bin": {
      "post": {
        "tags": [
          "Fit"
        ],
        "summary": "Fit the smallest custom bin",
        "description": "Fit-check every custom bin and return the result for the smallest bin the items fit into.",
        "operationId": "fit.customSmallestBin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FitCustomSmallestBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "bins": [
                  {
                    "id": "custom_bin_1",
                    "length": 10,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_2",
                    "length": 20,
                    "width": 40,
                    "height": 60
                  },
                  {
                    "id": "custom_bin_3",
                    "length": 30,
                    "width": 40,
                    "height": 60
                  }
                ],
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the fitting operation for the smallest custom bin the items fit into.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FitBinResponse"
                },
                "examples": {
                  "fitResponse": {
                    "summary": "Fit Response",
                    "description": "Example response for the smallest bin the items fit into.",
                    "value": {
                      "status": "Fits",
                      "bin": {
                        "id": "custom_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                      "earlyExitReason": "None"
                    }
                  },
                  "doesNotFitResponse": {
                    "summary": "Does Not Fit Response",
                    "description": "Example response when the items don't fit into any of the bins.",
                    "value": {
                      "status": "DoesNotFit",
                      "bin": {
                        "id": "custom_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA==",
                      "earlyExitReason": "None"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidBinData": {
                    "summary": "Invalid Bin Data",
                    "description": "Example response when you provide invalid Bin data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Bins": [
                          "IDs in `Bins` must be unique"
                        ],
                        "Bins[0].Length": [
                          "'Length' must be greater than '0'."
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/fit/bin/{preset}/{bin}": {
      "post": {
        "tags": [
          "Fit"
        ],
        "summary": "Fit a bin from a preset",
        "description": "Attempt to fit items into a bin from a preset. The preset and bin must be specified in the URL path.",
        "operationId": "fit.presetBin",
        "parameters": [
          {
            "name": "preset",
            "in": "path",
            "description": "Name of the preset to use.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "bin",
            "in": "path",
            "description": "Identifier of the bin within the preset.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FitPresetBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the fitting operation for the specified bin and items.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FitBinResponse"
                },
                "examples": {
                  "fitResponse": {
                    "summary": "Fit Response",
                    "description": "Example response when all items fit into the bin and no items are left unpacked.",
                    "value": {
                      "status": "Fits",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                      "earlyExitReason": "None"
                    }
                  },
                  "doesNotFitResponse": {
                    "summary": "Does Not Fit Response",
                    "description": "Example response when some items don't fit into the bin.",
                    "value": {
                      "status": "DoesNotFit",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA==",
                      "earlyExitReason": "None"
                    }
                  },
                  "earlyExitResponse": {
                    "summary": "Early Exit Response",
                    "description": "Example response when the early exit condition is met and the algorithm exits before starting.",
                    "value": {
                      "status": "EarlyExit",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [ ],
                      "unpackedItems": [
                        {
                          "id": "large_box",
                          "quantity": 1
                        }
                      ],
                      "packedItemsVolumePercentage": 0,
                      "packedBinVolumePercentage": 0,
                      "earlyExitReason": "ContainerDimensionExceeded"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found. If the preset or the bin in the specified preset does not exist."
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/fit/compare-bins/{preset}": {
      "post": {
        "tags": [
          "Fit"
        ],
        "summary": "Compare the bins in a preset",
        "description": "Fit-check every bin in a preset and return the result for each one.",
        "operationId": "fit.presetCompareBins",
        "parameters": [
          {
            "name": "preset",
            "in": "path",
            "description": "Name of the preset to use.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FitPresetCompareRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the fitting operation for every bin in the preset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FitCompareResponse"
                },
                "examples": {
                  "compareResponse": {
                    "summary": "Compare Response",
                    "description": "Example response with one result per bin in the preset, in the order the preset defines them.",
                    "value": {
                      "results": [
                        {
                          "status": "Fits",
                          "bin": {
                            "id": "preset_bin_1",
                            "length": 10,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 15.83,
                          "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                          "earlyExitReason": "None"
                        },
                        {
                          "status": "Fits",
                          "bin": {
                            "id": "preset_bin_2",
                            "length": 20,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 7.92,
                          "viPaqData": "AAAEABQoPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                          "earlyExitReason": "None"
                        },
                        {
                          "status": "Fits",
                          "bin": {
                            "id": "preset_bin_3",
                            "length": 30,
                            "width": 40,
                            "height": 60
                          },
                          "algorithmUsed": "FFD",
                          "packedItems": [
                            {
                              "id": "box_2",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 0,
                              "z": 0
                            },
                            {
                              "id": "box_3",
                              "length": 10,
                              "width": 12,
                              "height": 15,
                              "x": 0,
                              "y": 12,
                              "z": 0
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 0,
                              "z": 15
                            },
                            {
                              "id": "box_1",
                              "length": 2,
                              "width": 5,
                              "height": 10,
                              "x": 0,
                              "y": 24,
                              "z": 0
                            }
                          ],
                          "unpackedItems": [ ],
                          "packedItemsVolumePercentage": 100,
                          "packedBinVolumePercentage": 5.28,
                          "viPaqData": "AAAEAB4oPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                          "earlyExitReason": "None"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found. If the preset does not exist."
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v4/fit/smallest-bin/{preset}": {
      "post": {
        "tags": [
          "Fit"
        ],
        "summary": "Fit the smallest bin in a preset",
        "description": "Fit-check every bin in a preset and return the result for the smallest bin the items fit into.",
        "operationId": "fit.presetSmallestBin",
        "parameters": [
          {
            "name": "preset",
            "in": "path",
            "description": "Name of the preset to use.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FitPresetSmallestBinRequest"
              },
              "example": {
                "parameters": {
                  "algorithm": "Best",
                  "includeViPaqData": true
                },
                "items": [
                  {
                    "id": "box_1",
                    "quantity": 2,
                    "length": 2,
                    "width": 5,
                    "height": 10
                  },
                  {
                    "id": "box_2",
                    "quantity": 1,
                    "length": 12,
                    "width": 15,
                    "height": 10
                  },
                  {
                    "id": "box_3",
                    "quantity": 1,
                    "length": 12,
                    "width": 10,
                    "height": 15
                  }
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "500": {
            "description": "Internal Server Error. An unexpected error occurred. Exception details are shown only in a development environment.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "example": {
                  "type": "https://tools.ietf.org/html/rfc9110#section-15.6.1",
                  "title": "Unexpected Server Error",
                  "status": 500,
                  "detail": "An unexpected error occurred while processing your request. Please try again later or contact support."
                }
              }
            }
          },
          "200": {
            "description": "OK. Returns the result of the fitting operation for the smallest bin in the preset the items fit into.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FitBinResponse"
                },
                "examples": {
                  "fitResponse": {
                    "summary": "Fit Response",
                    "description": "Example response for the smallest bin in the preset that the items fit into.",
                    "value": {
                      "status": "Fits",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 0,
                          "z": 15
                        },
                        {
                          "id": "box_1",
                          "length": 2,
                          "width": 5,
                          "height": 10,
                          "x": 0,
                          "y": 24,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [ ],
                      "packedItemsVolumePercentage": 100,
                      "packedBinVolumePercentage": 15.83,
                      "viPaqData": "AAAEAAooPAoMDwAAAAoMDwAMAAIFCgAADwIFCgAYAA==",
                      "earlyExitReason": "None"
                    }
                  },
                  "doesNotFitResponse": {
                    "summary": "Does Not Fit Response",
                    "description": "Example response when the items don't fit into any bin in the preset.",
                    "value": {
                      "status": "DoesNotFit",
                      "bin": {
                        "id": "preset_bin_1",
                        "length": 10,
                        "width": 40,
                        "height": 60
                      },
                      "algorithmUsed": "FFD",
                      "packedItems": [
                        {
                          "id": "box_2",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 0,
                          "z": 0
                        },
                        {
                          "id": "box_3",
                          "length": 10,
                          "width": 12,
                          "height": 15,
                          "x": 0,
                          "y": 12,
                          "z": 0
                        }
                      ],
                      "unpackedItems": [
                        {
                          "id": "box_1",
                          "quantity": 2
                        }
                      ],
                      "packedItemsVolumePercentage": 94.74,
                      "packedBinVolumePercentage": 15.00,
                      "viPaqData": "AAACAAooPAoMDwAAAAoMDwAMAA==",
                      "earlyExitReason": "None"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad Request. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                },
                "examples": {
                  "invalidJson": {
                    "summary": "Invalid JSON",
                    "description": "Example response when JSON is invalid",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Invalid JSON Format",
                      "status": 400,
                      "detail": "'p' is an invalid start of a property name. Expected a '\"'. Path: $ | LineNumber: 1 | BytePositionInLine: 2."
                    }
                  },
                  "malformedRequest": {
                    "summary": "Malformed Request",
                    "description": "Example response when the server could not read the request",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
                      "title": "Malformed Request",
                      "status": 400,
                      "detail": "The server could not process the request because it is malformed or contains invalid data. Please verify the request format and try again."
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not Found. If the preset does not exist."
          },
          "422": {
            "description": "Unprocessable Content. The request is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/HttpValidationProblemDetails"
                },
                "examples": {
                  "invalidAlgorithm": {
                    "summary": "Invalid Algorithm",
                    "description": "Example response when you provide invalid algorithm",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Parameters.Algorithm": [
                          "'Algorithm' is required and must be one of the following values: FFD, WFD, BFD, Best"
                        ]
                      }
                    }
                  },
                  "invalidItemData": {
                    "summary": "Invalid Item Data",
                    "description": "Example response when you provide invalid Item data",
                    "value": {
                      "type": "https://tools.ietf.org/html/rfc4918#section-11.2",
                      "title": "One or more validation errors occurred.",
                      "status": 422,
                      "errors": {
                        "Items[1].Length": [
                          "'Length' must be less than or equal to '65535'."
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Algorithm": {
        "enum": [
          "FFD",
          "WFD",
          "BFD",
          "Best"
        ],
        "type": "string",
        "description": "The packing heuristic. FFD, WFD and BFD are the individual heuristics; Best runs more than one and keeps the best result - all three on fit/bin and pack/bin, FFD plus BFD on every other route."
      },
      "Bin": {
        "required": [
          "id",
          "length",
          "width",
          "height"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Caller-supplied identifier, echoed back on the matching result so requests and responses can be correlated."
          },
          "length": {
            "minimum": 1,
            "type": "integer",
            "description": "Length of the bin or item, in the same unit as the other dimensions.",
            "format": "int32"
          },
          "width": {
            "minimum": 1,
            "type": "integer",
            "description": "Width of the bin or item, in the same unit as the other dimensions.",
            "format": "int32"
          },
          "height": {
            "minimum": 1,
            "type": "integer",
            "description": "Height of the bin or item, in the same unit as the other dimensions.",
            "format": "int32"
          }
        },
        "description": "A bin (container) to pack items into or fit items against."
      },
      "BinFitEarlyExitReason": {
        "enum": [
          "None",
          "ContainerVolumeExceeded",
          "ContainerDimensionExceeded"
        ],
        "type": "string",
        "description": "Why a fit check stopped early, or None if it ran to completion."
      },
      "BinFitResultStatus": {
        "enum": [
          "Fits",
          "DoesNotFit",
          "EarlyExit",
          "Unknown"
        ],
        "type": "string",
        "description": "Outcome of a fit check."
      },
      "BinPackResultStatus": {
        "enum": [
          "FullyPacked",
          "PartiallyPacked",
          "NotPacked",
          "Unknown"
        ],
        "type": "string",
        "description": "Outcome of a packing operation."
      },
      "Box": {
        "required": [
          "id",
          "quantity",
          "length",
          "width",
          "height"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Caller-supplied identifier, echoed back on the matching result so requests and responses can be correlated."
          },
          "quantity": {
            "minimum": 1,
            "type": "integer",
            "description": "Number of identical items of this type.",
            "format": "int32"
          },
          "length": {
            "minimum": 1,
            "type": "integer",
            "description": "Length of the bin or item, in the same unit as the other dimensions.",
            "format": "int32"
          },
          "width": {
            "minimum": 1,
            "type": "integer",
            "description": "Width of the bin or item, in the same unit as the other dimensions.",
            "format": "int32"
          },
          "height": {
            "minimum": 1,
            "type": "integer",
            "description": "Height of the bin or item, in the same unit as the other dimensions.",
            "format": "int32"
          }
        },
        "description": "An item to pack or fit, with its dimensions and quantity."
      },
      "FitBinResponse": {
        "required": [
          "status",
          "bin",
          "algorithmUsed",
          "packedItemsVolumePercentage",
          "packedBinVolumePercentage",
          "earlyExitReason"
        ],
        "type": "object",
        "properties": {
          "status": {
            "description": "The outcome of the operation.",
            "$ref": "#/components/schemas/BinFitResultStatus"
          },
          "bin": {
            "description": "The bin these results are for.",
            "$ref": "#/components/schemas/Bin"
          },
          "algorithmUsed": {
            "type": "string",
            "description": "The algorithm actually used for this result. When Best is requested, this is the heuristic that won."
          },
          "packedItems": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PackedBox"
            },
            "description": "Items placed in the bin, each with its placement."
          },
          "unpackedItems": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UnpackedBox"
            },
            "description": "Items that could not be placed in the bin."
          },
          "packedItemsVolumePercentage": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Percentage of the items' volume that was packed (0-100).",
            "format": "double"
          },
          "packedBinVolumePercentage": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Percentage of the bin's volume filled by the packed items (0-100).",
            "format": "double"
          },
          "viPaqData": {
            "type": [
              "null",
              "string"
            ],
            "description": "The packing result encoded as a ViPaq protocol token (Base64). Present only when requested."
          },
          "earlyExitReason": {
            "description": "Why a fit check stopped early, or None if it ran to completion.",
            "$ref": "#/components/schemas/BinFitEarlyExitReason"
          }
        },
        "description": "The result of fitting items into a single bin."
      },
      "FitCompareResponse": {
        "required": [
          "results"
        ],
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FitBinResponse"
            },
            "description": "One result per bin considered."
          }
        },
        "description": "The fit result for each bin considered."
      },
      "FitCustomBinRequest": {
        "required": [
          "parameters",
          "bin",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "bin": {
            "description": "The bin these results are for.",
            "$ref": "#/components/schemas/Bin"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to check whether items fit into a custom bin."
      },
      "FitCustomCompareRequest": {
        "required": [
          "parameters",
          "bins",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "bins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bin"
            },
            "description": "The custom bins to consider."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to check whether items fit into each of several custom bins."
      },
      "FitCustomSmallestBinRequest": {
        "required": [
          "parameters",
          "bins",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "bins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bin"
            },
            "description": "The custom bins to consider."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to check the smallest fitting custom bin."
      },
      "FitPresetBinRequest": {
        "required": [
          "parameters",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to check whether items fit into a bin from a preset."
      },
      "FitPresetCompareRequest": {
        "required": [
          "parameters",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to check whether items fit into each bin of a preset."
      },
      "FitPresetSmallestBinRequest": {
        "required": [
          "parameters",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to check the smallest fitting bin of a preset."
      },
      "HttpValidationProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "A URI reference identifying the problem type (RFC 7807)."
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "A short, human-readable summary of the problem type (RFC 7807)."
          },
          "status": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The HTTP status code for this problem (RFC 7807).",
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ],
            "description": "A human-readable explanation specific to this occurrence (RFC 7807)."
          },
          "instance": {
            "type": [
              "null",
              "string"
            ],
            "description": "A URI reference identifying the specific occurrence of the problem (RFC 7807)."
          },
          "errors": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Validation errors, keyed by the field that failed."
          }
        },
        "description": "An RFC 7807 problem-details response that also lists per-field validation errors."
      },
      "OperationParameters": {
        "required": [
          "algorithm"
        ],
        "type": "object",
        "properties": {
          "algorithm": {
            "description": "The heuristic algorithm to use: FFD, WFD, BFD, or Best to run more than one and keep the best result. Best runs all three on fit/bin and pack/bin, and FFD plus BFD on every other route.",
            "$ref": "#/components/schemas/Algorithm"
          },
          "includeViPaqData": {
            "type": "boolean",
            "description": "When true, the packing result includes its ViPaq data token."
          }
        },
        "description": "Options that control how the operation runs."
      },
      "PackBinResponse": {
        "required": [
          "status",
          "bin",
          "algorithmUsed",
          "packedItemsVolumePercentage",
          "packedBinVolumePercentage"
        ],
        "type": "object",
        "properties": {
          "status": {
            "description": "The outcome of the operation.",
            "$ref": "#/components/schemas/BinPackResultStatus"
          },
          "bin": {
            "description": "The bin these results are for.",
            "$ref": "#/components/schemas/Bin"
          },
          "algorithmUsed": {
            "type": "string",
            "description": "The algorithm actually used for this result. When Best is requested, this is the heuristic that won."
          },
          "packedItems": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PackedBox"
            },
            "description": "Items placed in the bin, each with its placement."
          },
          "unpackedItems": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/UnpackedBox"
            },
            "description": "Items that could not be placed in the bin."
          },
          "packedItemsVolumePercentage": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Percentage of the items' volume that was packed (0-100).",
            "format": "double"
          },
          "packedBinVolumePercentage": {
            "maximum": 100,
            "minimum": 0,
            "type": "number",
            "description": "Percentage of the bin's volume filled by the packed items (0-100).",
            "format": "double"
          },
          "viPaqData": {
            "type": [
              "null",
              "string"
            ],
            "description": "The packing result encoded as a ViPaq protocol token (Base64). Present only when requested."
          }
        },
        "description": "The result of packing items into a single bin."
      },
      "PackCompareResponse": {
        "required": [
          "results"
        ],
        "type": "object",
        "properties": {
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PackBinResponse"
            },
            "description": "One result per bin considered."
          }
        },
        "description": "The packing result for each bin considered."
      },
      "PackCustomBestBinRequest": {
        "required": [
          "parameters",
          "bins",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "bins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bin"
            },
            "description": "The custom bins to consider."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to pack items into the best of several custom bins."
      },
      "PackCustomBinRequest": {
        "required": [
          "parameters",
          "bin",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "bin": {
            "description": "The bin these results are for.",
            "$ref": "#/components/schemas/Bin"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to pack items into a custom bin."
      },
      "PackCustomCompareRequest": {
        "required": [
          "parameters",
          "bins",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "bins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bin"
            },
            "description": "The custom bins to consider."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to pack items into each of several custom bins."
      },
      "PackCustomSmallestBinRequest": {
        "required": [
          "parameters",
          "bins",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "bins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bin"
            },
            "description": "The custom bins to consider."
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to pack items into the smallest fitting custom bin."
      },
      "PackedBox": {
        "required": [
          "id",
          "length",
          "width",
          "height",
          "x",
          "y",
          "z"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Caller-supplied identifier, echoed back on the matching result so requests and responses can be correlated."
          },
          "length": {
            "minimum": 1,
            "type": "integer",
            "description": "Length of the bin or item, in the same unit as the other dimensions.",
            "format": "int32"
          },
          "width": {
            "minimum": 1,
            "type": "integer",
            "description": "Width of the bin or item, in the same unit as the other dimensions.",
            "format": "int32"
          },
          "height": {
            "minimum": 1,
            "type": "integer",
            "description": "Height of the bin or item, in the same unit as the other dimensions.",
            "format": "int32"
          },
          "x": {
            "minimum": 0,
            "type": "integer",
            "description": "Placement of the item along the length axis, measured from the bin origin.",
            "format": "int32"
          },
          "y": {
            "minimum": 0,
            "type": "integer",
            "description": "Placement of the item along the width axis, measured from the bin origin.",
            "format": "int32"
          },
          "z": {
            "minimum": 0,
            "type": "integer",
            "description": "Placement of the item along the height axis, measured from the bin origin.",
            "format": "int32"
          }
        },
        "description": "An item placed inside the bin, with its position."
      },
      "PackPresetBestBinRequest": {
        "required": [
          "parameters",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to pack items into the best bin of a preset."
      },
      "PackPresetBinRequest": {
        "required": [
          "parameters",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to pack items into a bin from a preset."
      },
      "PackPresetCompareRequest": {
        "required": [
          "parameters",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to pack items into each bin of a preset."
      },
      "PackPresetSmallestBinRequest": {
        "required": [
          "parameters",
          "items"
        ],
        "type": "object",
        "properties": {
          "parameters": {
            "description": "Options controlling the operation, such as the algorithm to use.",
            "$ref": "#/components/schemas/OperationParameters"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Box"
            },
            "description": "The items to fit or pack."
          }
        },
        "description": "A request to pack items into the smallest fitting bin of a preset."
      },
      "PresetListResponse": {
        "required": [
          "presets"
        ],
        "type": "object",
        "properties": {
          "presets": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Bin"
              }
            },
            "description": "The presets configured on the server."
          }
        },
        "description": "The presets configured on the server."
      },
      "PresetResponse": {
        "required": [
          "name",
          "bins"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "The preset's name."
          },
          "bins": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Bin"
            },
            "description": "The custom bins to consider."
          }
        },
        "description": "A preset and the bins it contains."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ],
            "description": "A URI reference identifying the problem type (RFC 7807)."
          },
          "title": {
            "type": [
              "null",
              "string"
            ],
            "description": "A short, human-readable summary of the problem type (RFC 7807)."
          },
          "status": {
            "type": [
              "null",
              "integer"
            ],
            "description": "The HTTP status code for this problem (RFC 7807).",
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ],
            "description": "A human-readable explanation specific to this occurrence (RFC 7807)."
          },
          "instance": {
            "type": [
              "null",
              "string"
            ],
            "description": "A URI reference identifying the specific occurrence of the problem (RFC 7807)."
          }
        },
        "description": "An error response in RFC 7807 problem-details format."
      },
      "UnpackedBox": {
        "required": [
          "id",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Caller-supplied identifier, echoed back on the matching result so requests and responses can be correlated."
          },
          "quantity": {
            "minimum": 1,
            "type": "integer",
            "description": "Number of identical items of this type.",
            "format": "int32"
          }
        },
        "description": "An item that could not be placed in the bin."
      }
    }
  },
  "tags": [
    {
      "name": "Presets",
      "description": "Predefined bin sets configured on the server."
    },
    {
      "name": "Pack",
      "description": "Pack items into bins and report how they fit."
    },
    {
      "name": "Fit",
      "description": "Check whether items fit into bins, without computing a full packing."
    }
  ]
}