{
 "openapi": "3.1.0",
 "info": {
  "title": "Freight Orders (Supply Chain)",
  "version": "20261030b",
  "description": "The instruction to a carrier: collect here, deliver there, these stops in this order. Tendered, accepted, refused, offered to the next one down."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "freight-orders": {
    "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
     },
     "freight_order_no": {
      "type": "string",
      "description": "Freight order no",
      "readOnly": true
     },
     "load_id": {
      "type": "string",
      "format": "uuid",
      "description": "Load"
     },
     "carrier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Carrier"
     },
     "carrier_service_id": {
      "type": "string",
      "format": "uuid",
      "description": "Service"
     },
     "transport_lane_id": {
      "type": "string",
      "format": "uuid",
      "description": "Lane"
     },
     "tariff_id": {
      "type": "string",
      "format": "uuid",
      "description": "Tariff"
     },
     "direction": {
      "type": "string",
      "description": "Direction",
      "enum": [
       "outbound",
       "inbound",
       "transfer",
       "return",
       "third_party"
      ]
     },
     "mode": {
      "type": "string",
      "description": "Mode"
     },
     "incoterm": {
      "type": "string",
      "description": "Incoterm"
     },
     "payment_terms": {
      "type": "string",
      "description": "Who pays"
     },
     "bill_to_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Bill to"
     },
     "bol_no": {
      "type": "string",
      "description": "Bill of lading"
     },
     "pro_no": {
      "type": "string",
      "description": "Carrier number"
     },
     "tracking_no": {
      "type": "string",
      "description": "Tracking number"
     },
     "pickup_no": {
      "type": "string",
      "description": "Collection number"
     },
     "customer_ref": {
      "type": "string",
      "description": "Customer reference"
     },
     "requested_pickup_at": {
      "type": "string",
      "format": "date-time",
      "description": "Requested collection"
     },
     "pickup_at": {
      "type": "string",
      "format": "date-time",
      "description": "Collected"
     },
     "requested_delivery_at": {
      "type": "string",
      "format": "date-time",
      "description": "Requested delivery"
     },
     "promised_delivery_at": {
      "type": "string",
      "format": "date-time",
      "description": "Promised delivery"
     },
     "delivered_at": {
      "type": "string",
      "format": "date-time",
      "description": "Delivered"
     },
     "quoted_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Quoted"
     },
     "accrued_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Accrued amount",
      "readOnly": true
     },
     "invoiced_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Invoiced amount",
      "readOnly": true
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Cost center"
     },
     "total_weight_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Total weight kg",
      "readOnly": true
     },
     "chargeable_weight_kg": {
      "type": "string",
      "format": "decimal",
      "description": "Chargeable weight kg",
      "readOnly": true
     },
     "total_volume_l": {
      "type": "string",
      "format": "decimal",
      "description": "Total volume l",
      "readOnly": true
     },
     "piece_count": {
      "type": "integer",
      "description": "Piece count",
      "readOnly": true
     },
     "declared_value": {
      "type": "string",
      "format": "decimal",
      "description": "Declared value"
     },
     "is_hazardous": {
      "type": "boolean",
      "description": "Dangerous goods"
     },
     "is_temperature_controlled": {
      "type": "boolean",
      "description": "Temperature controlled"
     },
     "temperature_min_c": {
      "type": "string",
      "format": "decimal",
      "description": "Minimum temperature (C)"
     },
     "temperature_max_c": {
      "type": "string",
      "format": "decimal",
      "description": "Maximum temperature (C)"
     },
     "special_instructions": {
      "type": "string",
      "description": "Special instructions"
     },
     "tendered_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tendered at",
      "readOnly": true
     },
     "tender_response_at": {
      "type": "string",
      "format": "date-time",
      "description": "Tender response at",
      "readOnly": true
     },
     "tender_attempts": {
      "type": "integer",
      "description": "Tender attempts",
      "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/freight-orders": {
   "get": {
    "summary": "list freight-orders",
    "operationId": "list_freight_orders_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create freight-orders",
    "operationId": "create_freight_orders_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/freight-orders/{id}": {
   "get": {
    "summary": "get freight-orders",
    "operationId": "get_freight_orders_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change freight-orders",
    "operationId": "change_freight_orders_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete freight-orders",
    "operationId": "delete_freight_orders_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/freight-orders/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_freight_orders_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/freight-orders/{id}/tender": {
   "post": {
    "summary": "Tender",
    "operationId": "action_freight_orders_0_6",
    "description": "Body keys: response, carrierId, note",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/freight-orders/{id}/track": {
   "post": {
    "summary": "Track",
    "operationId": "action_freight_orders_0_6",
    "description": "Body keys: eventType, eventCode, description, occurredAt, city, region, country, latitude, longitude, signedBy, source, exceptionCode; eventType one of booked|picked_up|departed|arrived|in_transit|customs_hold|customs_cleared|out_for_delivery|delivered|exception|delayed|refused|returned|lost|damaged|geofence_enter|geofence_exit|position; source one of carrier_api|webhook|edi|telematics|geofence|manual|driver_app|email",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/freight-orders/{id}/tracking": {
   "get": {
    "summary": "Tracking",
    "operationId": "action_freight_orders_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/freight-orders/{parentId}/lines": {
   "get": {
    "summary": "Lines",
    "operationId": "action_freight_orders_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Lines",
    "operationId": "action_freight_orders_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/freight-orders/{parentId}/lines/{lineId}": {
   "put": {
    "summary": "Lines",
    "operationId": "action_freight_orders_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Lines",
    "operationId": "action_freight_orders_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/freight-orders/{parentId}/charges": {
   "get": {
    "summary": "Charges",
    "operationId": "action_freight_orders_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Charges",
    "operationId": "action_freight_orders_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/freight-orders/{parentId}/charges/{lineId}": {
   "put": {
    "summary": "Charges",
    "operationId": "action_freight_orders_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Charges",
    "operationId": "action_freight_orders_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}