{
 "openapi": "3.1.0",
 "info": {
  "title": "Yard Movements (Supply Chain)",
  "version": "20261030b",
  "description": "A trailer stay: it arrived, it sat here, it went on a door, it left. Dwell time is what this exists to produce, because detention is charged by the hour and nobody can argue about it without a record. Booking a truck’s arrival at a gate or door against an order is a Dock Appointment, not a yard movement (IN PFC TKT-000009)."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "yard-movements": {
    "type": "object",
    "required": [
     "warehouse_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
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Warehouse"
     },
     "movement_no": {
      "type": "string",
      "description": "Movement no",
      "readOnly": true
     },
     "trailer_no": {
      "type": "string",
      "description": "Trailer number"
     },
     "tractor_no": {
      "type": "string",
      "description": "Tractor number"
     },
     "vehicle_id": {
      "type": "string",
      "format": "uuid",
      "description": "Vehicle"
     },
     "carrier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Carrier"
     },
     "load_id": {
      "type": "string",
      "format": "uuid",
      "description": "Load"
     },
     "driver_name": {
      "type": "string",
      "description": "Driver"
     },
     "direction": {
      "type": "string",
      "description": "Direction",
      "enum": [
       "inbound",
       "outbound",
       "both",
       "empty"
      ]
     },
     "from_yard_location_id": {
      "type": "string",
      "format": "uuid",
      "description": "From spot"
     },
     "to_yard_location_id": {
      "type": "string",
      "format": "uuid",
      "description": "To spot"
     },
     "door_id": {
      "type": "string",
      "format": "uuid",
      "description": "Door"
     },
     "arrived_at": {
      "type": "string",
      "format": "date-time",
      "description": "Arrived"
     },
     "checked_in_at": {
      "type": "string",
      "format": "date-time",
      "description": "Checked in"
     },
     "docked_at": {
      "type": "string",
      "format": "date-time",
      "description": "On the door"
     },
     "undocked_at": {
      "type": "string",
      "format": "date-time",
      "description": "Off the door"
     },
     "departed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Departed"
     },
     "appointment_at": {
      "type": "string",
      "format": "date-time",
      "description": "Appointment"
     },
     "seal_no": {
      "type": "string",
      "description": "Seal number"
     },
     "seal_intact": {
      "type": "boolean",
      "description": "Seal intact"
     },
     "is_refrigerated": {
      "type": "boolean",
      "description": "Refrigerated"
     },
     "temperature_c": {
      "type": "string",
      "format": "decimal",
      "description": "Temperature (C)"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "expected",
       "arrived",
       "checked_in",
       "at_door",
       "loading",
       "unloading",
       "complete",
       "departed",
       "rejected",
       "cancelled"
      ]
     },
     "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/yard-movements": {
   "get": {
    "summary": "list yard-movements",
    "operationId": "list_yard_movements_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create yard-movements",
    "operationId": "create_yard_movements_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/yard-movements/{id}": {
   "get": {
    "summary": "get yard-movements",
    "operationId": "get_yard_movements_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change yard-movements",
    "operationId": "change_yard_movements_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete yard-movements",
    "operationId": "delete_yard_movements_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/yard-movements/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_yard_movements_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"
     }
    }
   }
  }
 }
}