{
  "openapi": "3.1.0",
  "info": {
    "title": "Navo Loading API",
    "version": "1.0.0",
    "description": "3D container & truck load planning with a compliance engine. POST cargo, get back the packed plan and a ready-or-blockers compliance verdict (SOLAS VGM, IMDG 7.2.4 segregation, axle loads + US Bridge Formula, McKee carton crush, centre of gravity, securing). API keys come with a paid Business plan: https://loadingmcp.com/pricing",
    "contact": {
      "url": "https://loadingmcp.com/docs/api"
    }
  },
  "servers": [
    {
      "url": "https://api.navo24.com/v1/loading",
      "description": "Navo API"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/plan": {
      "post": {
        "operationId": "planLoad",
        "summary": "Compute a 3D load plan + compliance verdict",
        "description": "Stateless load solve. Send cargo items and optionally an equipmentCode; omit it to auto right-size to the cheapest equipment that fits (reefer-gated for refrigerated cargo). Runs the production PackingSolver optimizer; the response reports which engine produced the plan.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlanRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The packed plan and compliance verdict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlanResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid body (missing items, bad dimensions, unknown equipmentCode, dry container for refrigerated cargo, or no container fits)."
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The org has no active LoadingMCP subscription."
          }
        },
        "tags": [
          "Loading"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key from a paid plan, e.g. Authorization: Bearer lmcp_YOUR_KEY"
      }
    },
    "schemas": {
      "CargoItem": {
        "type": "object",
        "required": [
          "length",
          "width",
          "height"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "box",
              "pallet",
              "drum",
              "cylinder",
              "bigbag",
              "roll",
              "sack"
            ],
            "default": "box",
            "description": "Drives packing realism: drums/cylinders/rolls hex-nest; big bags/sacks are soft cargo that loads on top and is never crushed."
          },
          "length": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "mm"
          },
          "width": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "mm"
          },
          "height": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "mm"
          },
          "weightKg": {
            "type": "number",
            "description": "Weight per unit, kg."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "default": 1
          },
          "stackable": {
            "type": "boolean",
            "default": true
          },
          "maxStackWeightKg": {
            "type": "number",
            "description": "Max weight this unit can carry on top, kg."
          },
          "fragile": {
            "type": "boolean",
            "description": "Implies thisSideUp and upright-only rotations."
          },
          "thisSideUp": {
            "type": "boolean",
            "description": "Restricts to upright orientations."
          },
          "bulky": {
            "type": "boolean",
            "description": "Awkward cargo: never stacked on, nothing on top."
          },
          "refrigerated": {
            "type": "boolean",
            "description": "Requires reefer equipment."
          },
          "hazmatClass": {
            "type": "string",
            "description": "IMDG class, e.g. \"3\", \"5.1\" — enables IMDG 7.2.4 segregation checks."
          },
          "deliveryStop": {
            "type": "integer",
            "minimum": 1,
            "description": "Multi-drop stop number (1 = first drop) for stop-sequenced loading."
          },
          "boardEctLbIn": {
            "type": "number",
            "description": "Corrugated board ECT (lb/in) for the McKee crush limit."
          },
          "boardCaliperMm": {
            "type": "number",
            "description": "Board caliper (mm) for the McKee crush limit."
          },
          "doubleWall": {
            "type": "boolean"
          },
          "color": {
            "type": "string",
            "description": "Hex colour for the 3D render."
          }
        }
      },
      "PlanRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "equipmentCode": {
            "type": "string",
            "description": "Equipment code, e.g. 20GP, 40GP, 40HC, 45HC, 20RF, 40RH, TRUCK_EU_13_6, TRUCK_53_DV, PALLET_EUR. Omit to auto right-size."
          },
          "mode": {
            "type": "string",
            "enum": [
              "sea",
              "road",
              "air"
            ],
            "default": "sea",
            "description": "Scopes the auto right-size to usable equipment; ignored when equipmentCode is explicit."
          },
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "$ref": "#/components/schemas/CargoItem"
            }
          },
          "options": {
            "type": "object",
            "properties": {
              "multiStuffing": {
                "type": "boolean",
                "default": true,
                "description": "Allow splitting across multiple containers."
              },
              "cogTarget": {
                "type": "object",
                "properties": {
                  "x": {
                    "type": "number"
                  },
                  "y": {
                    "type": "number"
                  }
                },
                "description": "Balance point to pack toward (fractional offsets)."
              },
              "vgm": {
                "type": "object",
                "properties": {
                  "declaredKg": {
                    "type": "array",
                    "items": {
                      "type": "number"
                    },
                    "description": "Shipper-declared gross mass per container, kg."
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "M1",
                      "M2"
                    ]
                  },
                  "dunnageKg": {
                    "type": "number"
                  }
                },
                "description": "SOLAS VGM declaration to cross-check against the computed estimate."
              },
              "jurisdiction": {
                "type": "string",
                "enum": [
                  "EU",
                  "US",
                  "CN",
                  "AU",
                  "AU-WA",
                  "AU-NT"
                ],
                "description": "Road jurisdiction for the axle / gross-weight check (EU 96/53/EC, US 23 CFR 658.17 + Bridge Formula B, CN GB 1589-2016, AU HVNL Mass, Dimension and Loading National Regulation Sch 1 general mass limits, AU-WA Road Traffic (Vehicles) Regulations 2014 (WA) Part 8, AU-NT Motor Vehicles (Standards) Regulations 2003 (NT)). Australian jurisdictions also secure the load to the HVNL Sch 7 loading performance standards. Default EU."
              },
              "massLimits": {
                "type": "string",
                "enum": [
                  "general",
                  "hml"
                ],
                "default": "general",
                "description": "Australian mass tier. hml = HVNL Higher Mass Limits (AU, Schedule 5: tri-axle 22.5 t, 6-axle combination 45.5 t; needs an HML route, road-friendly suspension and, for a tri-axle, mass accreditation) or the NT road-friendly-suspension limits (AU-NT, r 8). Ignored elsewhere; AU-WA has no as-of-right higher tier."
              },
              "complyingSteerAxle": {
                "type": "boolean",
                "default": false,
                "description": "The prime mover is an HVNL complying steer axle vehicle (6.5 t steer, 44 t combination under general limits). AU only."
              },
              "vehicleTareKg": {
                "type": "number",
                "exclusiveMinimum": 0,
                "description": "Your road vehicle tare in kg (container: prime mover + chassis or skeletal; truck: the truck). Replaces the nominal tare in the gross-combination check (AU default 14,100 kg, elsewhere 11,600 kg for a container combination)."
              },
              "sequenceStops": {
                "type": "boolean",
                "description": "Zone the load by deliveryStop, nose to doors."
              }
            }
          }
        }
      },
      "PlanResponse": {
        "type": "object",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "engine": {
            "type": "string",
            "description": "Which packer produced the plan: \"packingsolver\" (production optimizer) or \"offline-fallback\"."
          },
          "equipmentCode": {
            "type": "string"
          },
          "autoSized": {
            "type": "boolean",
            "description": "True when the equipment was chosen by cost-aware right-sizing."
          },
          "plan": {
            "type": "object",
            "description": "The packed 3D plan: bins, placements, and metrics — volume/payload utilization, centre of gravity, and metrics.compliance with { ready, blockers[], vgm, axle, segregation, crush, securing }.",
            "properties": {
              "metrics": {
                "type": "object",
                "properties": {
                  "volumeUtilPct": {
                    "type": "number"
                  },
                  "payloadUtilPct": {
                    "type": "number"
                  },
                  "compliance": {
                    "type": "object",
                    "properties": {
                      "ready": {
                        "type": "boolean"
                      },
                      "blockers": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
