{
 "openapi": "3.1.0",
 "info": {
  "title": "Loads (Supply Chain)",
  "version": "20261030b",
  "description": "One vehicle worth of freight. Utilization is the whole point: a trailer at sixty per cent is forty per cent of the freight bill spent carrying air."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "loads": {
    "type": "object",
    "required": [],
    "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
     },
     "load_no": {
      "type": "string",
      "description": "Load no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "load_type": {
      "type": "string",
      "description": "Type"
     },
     "vehicle_type_id": {
      "type": "string",
      "format": "uuid",
      "description": "Vehicle type"
     },
     "vehicle_id": {
      "type": "string",
      "format": "uuid",
      "description": "Vehicle"
     },
     "driver_id": {
      "type": "string",
      "format": "uuid",
      "description": "Driver"
     },
     "carrier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Carrier"
     },
     "carrier_service_id": {
      "type": "string",
      "format": "uuid",
      "description": "Service"
     },
     "trailer_no": {
      "type": "string",
      "description": "Trailer number"
     },
     "seal_no": {
      "type": "string",
      "description": "Seal number"
     },
     "origin_place_id": {
      "type": "string",
      "format": "uuid",
      "description": "From"
     },
     "destination_place_id": {
      "type": "string",
      "format": "uuid",
      "description": "To"
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Loaded at"
     },
     "door_id": {
      "type": "string",
      "format": "uuid",
      "description": "Door"
     },
     "planned_depart_at": {
      "type": "string",
      "format": "date-time",
      "description": "Planned departure"
     },
     "planned_arrive_at": {
      "type": "string",
      "format": "date-time",
      "description": "Planned arrival"
     },
     "actual_depart_at": {
      "type": "string",
      "format": "date-time",
      "description": "Actual departure"
     },
     "actual_arrive_at": {
      "type": "string",
      "format": "date-time",
      "description": "Actual arrival"
     },
     "total_weight_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Total weight kg",
      "readOnly": true
     },
     "total_volume_l": {
      "type": "string",
      "format": "decimal",
      "description": "Total volume l",
      "readOnly": true
     },
     "pallet_count": {
      "type": "integer",
      "description": "Pallet count",
      "readOnly": true
     },
     "piece_count": {
      "type": "integer",
      "description": "Piece count",
      "readOnly": true
     },
     "stop_count": {
      "type": "integer",
      "description": "Stop count",
      "readOnly": true
     },
     "distance_km": {
      "type": "string",
      "format": "decimal",
      "description": "Distance (km)"
     },
     "weight_utilization_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Weight utilization pct",
      "readOnly": true
     },
     "volume_utilization_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Volume utilization pct",
      "readOnly": true
     },
     "floor_utilization_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Floor utilization pct",
      "readOnly": true
     },
     "front_axle_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Front axle kg",
      "readOnly": true
     },
     "rear_axle_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Rear axle kg",
      "readOnly": true
     },
     "center_of_gravity_mm": {
      "type": "string",
      "format": "decimal",
      "description": "Center of gravity mm",
      "readOnly": true
     },
     "is_axle_legal": {
      "type": "boolean",
      "description": "Is axle legal",
      "readOnly": true
     },
     "planned_cost": {
      "type": "string",
      "format": "decimal",
      "description": "Planned cost"
     },
     "actual_cost": {
      "type": "string",
      "format": "decimal",
      "description": "Actual cost"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Cost center"
     },
     "co2_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Co2 kg",
      "readOnly": true
     },
     "planning_method": {
      "type": "string",
      "description": "Planning method",
      "readOnly": true
     },
     "built_by": {
      "type": "string",
      "format": "uuid",
      "description": "Built by",
      "readOnly": true
     },
     "built_at": {
      "type": "string",
      "format": "date-time",
      "description": "Built at",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "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/loads": {
   "get": {
    "summary": "list loads",
    "operationId": "list_loads_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create loads",
    "operationId": "create_loads_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/{id}": {
   "get": {
    "summary": "get loads",
    "operationId": "get_loads_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change loads",
    "operationId": "change_loads_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete loads",
    "operationId": "delete_loads_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_loads_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/loads/{id}/plan": {
   "get": {
    "summary": "Plan",
    "operationId": "action_loads_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/{id}/place": {
   "post": {
    "summary": "Place",
    "operationId": "action_loads_0_6",
    "description": "Body keys: itemId*, xMm, yMm, zMm, isRotated, stackLevel, stopId",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/{id}/arrange": {
   "post": {
    "summary": "Arrange",
    "operationId": "action_loads_0_6",
    "description": "Body keys: allowRotation, gapMm",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/build": {
   "post": {
    "summary": "Build",
    "operationId": "action_loads_0_5",
    "description": "Body keys: deliveryIds*, vehicleTypeId, warehouseId, loadType, plannedDepartAt, name; loadType one of ltl|truckload|parcel|multi_stop|milk_run|pool|cross_dock|container|backhaul",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/{id}/create-freight-order": {
   "post": {
    "summary": "Create freight order",
    "operationId": "action_loads_0_6",
    "description": "Body keys: carrierId, carrierServiceId, tariffId, quotedAmount, quoteOptionId, direction, paymentTerms; direction one of outbound|inbound|transfer|return|third_party; paymentTerms one of prepaid|collect|third_party|prepaid_and_charge",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/{parentId}/stops": {
   "get": {
    "summary": "Stops",
    "operationId": "action_loads_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Stops",
    "operationId": "action_loads_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/{parentId}/stops/{lineId}": {
   "put": {
    "summary": "Stops",
    "operationId": "action_loads_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Stops",
    "operationId": "action_loads_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/{parentId}/items": {
   "get": {
    "summary": "Items",
    "operationId": "action_loads_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Items",
    "operationId": "action_loads_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/loads/{parentId}/items/{lineId}": {
   "put": {
    "summary": "Items",
    "operationId": "action_loads_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Items",
    "operationId": "action_loads_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}