{
 "openapi": "3.1.0",
 "info": {
  "title": "Handling Units (Supply Chain)",
  "version": "20261030b",
  "description": "The actual, physical, numbered thing on the floor: pallet, carton, container. They nest, and the weight of a parent is the sum of everything under it — maintained rather than typed, because a pallet whose weight is a guess is a pallet that overloads an axle."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "handling-units": {
    "type": "object",
    "required": [
     "package_type_id"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "hu_no": {
      "type": "string",
      "description": "Hu no",
      "readOnly": true
     },
     "sscc": {
      "type": "string",
      "description": "SSCC"
     },
     "package_type_id": {
      "type": "string",
      "format": "uuid",
      "description": "Package type"
     },
     "parent_hu_id": {
      "type": "string",
      "format": "uuid",
      "description": "Inside handling unit"
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Warehouse"
     },
     "bin_id": {
      "type": "string",
      "format": "uuid",
      "description": "Bin"
     },
     "location_id": {
      "type": "string",
      "format": "uuid",
      "description": "Location id"
     },
     "tare_weight_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Tare weight (kg)"
     },
     "net_weight_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Net weight kg",
      "readOnly": true
     },
     "gross_weight_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Gross weight kg",
      "readOnly": true
     },
     "volume_l": {
      "type": "string",
      "format": "decimal",
      "description": "Volume l",
      "readOnly": true
     },
     "length_mm": {
      "type": "string",
      "format": "decimal",
      "description": "Length (mm)"
     },
     "width_mm": {
      "type": "string",
      "format": "decimal",
      "description": "Width (mm)"
     },
     "height_mm": {
      "type": "string",
      "format": "decimal",
      "description": "Height (mm)"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "planned",
       "open",
       "packed",
       "staged",
       "loaded",
       "shipped",
       "received",
       "unpacked",
       "emptied",
       "cancelled"
      ]
     },
     "hu_type": {
      "type": "string",
      "description": "Direction",
      "enum": [
       "inbound",
       "outbound",
       "internal",
       "returnable",
       "fixed"
      ]
     },
     "receipt_id": {
      "type": "string",
      "format": "uuid",
      "description": "Receipt id"
     },
     "delivery_id": {
      "type": "string",
      "format": "uuid",
      "description": "For delivery"
     },
     "load_id": {
      "type": "string",
      "format": "uuid",
      "description": "Load id",
      "readOnly": true
     },
     "freight_order_id": {
      "type": "string",
      "format": "uuid",
      "description": "Freight order id",
      "readOnly": true
     },
     "is_dangerous_goods": {
      "type": "boolean",
      "description": "Dangerous goods"
     },
     "seal_no": {
      "type": "string",
      "description": "Seal number"
     },
     "temperature_c": {
      "type": "string",
      "format": "decimal",
      "description": "Temperature (C)"
     },
     "packed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Packed at",
      "readOnly": true
     },
     "packed_by": {
      "type": "string",
      "format": "uuid",
      "description": "Packed by",
      "readOnly": true
     },
     "label_printed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Label printed at",
      "readOnly": true
     },
     "external_ref": {
      "type": "string",
      "description": "Reference over there"
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/scm/handling-units": {
   "get": {
    "summary": "list handling-units",
    "operationId": "list_handling_units_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create handling-units",
    "operationId": "create_handling_units_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/handling-units/{id}": {
   "get": {
    "summary": "get handling-units",
    "operationId": "get_handling_units_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change handling-units",
    "operationId": "change_handling_units_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete handling-units",
    "operationId": "delete_handling_units_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/handling-units/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_handling_units_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/handling-units/pack": {
   "post": {
    "summary": "Pack",
    "operationId": "action_handling_units_0_5",
    "description": "Body keys: packageTypeId*, warehouseId, binId, huType, deliveryId, receiptId, sealNo, huNo, notes; huType one of inbound|outbound|internal|returnable|fixed; contents*: [{ itemId, childHuId, netWeightKg, volumeL, quantity, uomId, lotNo, serialId, expiryDate }]",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/handling-units/{id}/nest": {
   "post": {
    "summary": "Nest",
    "operationId": "action_handling_units_0_6",
    "description": "Body keys: parentHuId",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/handling-units/{id}/contents": {
   "get": {
    "summary": "Contents",
    "operationId": "action_handling_units_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/handling-units/{parentId}/contents": {
   "get": {
    "summary": "Contents",
    "operationId": "action_handling_units_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Contents",
    "operationId": "action_handling_units_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/handling-units/{parentId}/contents/{lineId}": {
   "put": {
    "summary": "Contents",
    "operationId": "action_handling_units_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Contents",
    "operationId": "action_handling_units_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}