{
 "openapi": "3.1.0",
 "info": {
  "title": "Load Stops (Supply Chain)",
  "version": "20261030b",
  "description": "Where the vehicle stops, in order. The sequence decides the loading order, because the first delivery has to be at the back of the trailer."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "load-stops": {
    "type": "object",
    "required": [
     "load_id",
     "stop_no"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "load_id": {
      "type": "string",
      "format": "uuid",
      "description": "Load"
     },
     "stop_no": {
      "type": "integer",
      "description": "Stop number"
     },
     "stop_type": {
      "type": "string",
      "description": "Type",
      "enum": [
       "pickup",
       "delivery",
       "both",
       "cross_dock",
       "fuel",
       "rest",
       "border",
       "port",
       "customs"
      ]
     },
     "place_id": {
      "type": "string",
      "format": "uuid",
      "description": "Place"
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Customer"
     },
     "supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Supplier id"
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Warehouse id"
     },
     "address_line1": {
      "type": "string",
      "description": "Address"
     },
     "city": {
      "type": "string",
      "description": "City"
     },
     "region": {
      "type": "string",
      "description": "Region"
     },
     "postal_code": {
      "type": "string",
      "description": "Postal code"
     },
     "country": {
      "type": "string",
      "description": "Country"
     },
     "latitude": {
      "type": "string",
      "format": "decimal",
      "description": "Latitude"
     },
     "longitude": {
      "type": "string",
      "format": "decimal",
      "description": "Longitude"
     },
     "window_from": {
      "type": "string",
      "format": "date-time",
      "description": "Window from"
     },
     "window_to": {
      "type": "string",
      "format": "date-time",
      "description": "Window to"
     },
     "planned_arrive_at": {
      "type": "string",
      "format": "date-time",
      "description": "Planned arrival"
     },
     "planned_depart_at": {
      "type": "string",
      "format": "date-time",
      "description": "Planned depart at"
     },
     "actual_arrive_at": {
      "type": "string",
      "format": "date-time",
      "description": "Actual arrive at"
     },
     "actual_depart_at": {
      "type": "string",
      "format": "date-time",
      "description": "Actual depart at"
     },
     "appointment_no": {
      "type": "string",
      "description": "Appointment number"
     },
     "service_minutes": {
      "type": "string",
      "format": "decimal",
      "description": "Minutes on site"
     },
     "distance_from_previous_km": {
      "type": "string",
      "format": "decimal",
      "description": "Distance from previous km",
      "readOnly": true
     },
     "drive_minutes_from_previous": {
      "type": "string",
      "format": "decimal",
      "description": "Drive minutes from previous",
      "readOnly": true
     },
     "weight_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Weight kg",
      "readOnly": true
     },
     "volume_l": {
      "type": "string",
      "format": "decimal",
      "description": "Volume l",
      "readOnly": true
     },
     "pieces": {
      "type": "integer",
      "description": "Pieces",
      "readOnly": true
     },
     "signed_by": {
      "type": "string",
      "description": "Signed for by"
     },
     "pod_at": {
      "type": "string",
      "format": "date-time",
      "description": "Proof of delivery at"
     },
     "pod_notes": {
      "type": "string",
      "description": "Delivery notes"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "planned",
       "en_route",
       "arrived",
       "working",
       "departed",
       "completed",
       "refused",
       "failed",
       "cancelled"
      ]
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "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/load-stops": {
   "get": {
    "summary": "list load-stops",
    "operationId": "list_load_stops_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create load-stops",
    "operationId": "create_load_stops_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/load-stops/{id}": {
   "get": {
    "summary": "get load-stops",
    "operationId": "get_load_stops_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change load-stops",
    "operationId": "change_load_stops_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete load-stops",
    "operationId": "delete_load_stops_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/load-stops/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_load_stops_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"
     }
    }
   }
  }
 }
}