FreightMath Data Schema
The FreightMath Data Schema defines the fields, relationships, and minimum business rules required for order-level and segment-level data exchanged between trucking company transportation management systems (TMS) and FreightMath. It ensures a consistent, auditable structure for all FreightMath analytics, pricing tools, and dashboards.
Tier 2 — Technical Field-by-field specification for data engineers, matching the Excel schema provided by KSMTA (Order and Segment field lists, required flags, data types, and descriptions).
Download Schema & Sample Data
Download the current FreightMath Data Schema workbook, which includes both the Order and Segment schemas plus sample data for each.
- FreightMath Data Schema & Samples (Excel) — Download Data Schema Workbook
Tier 1 — Conceptual Overview
1. Entities & Relationships
The FreightMath schema is organized around two core entities:
- Orders — a single customer shipment or load, including who tendered it, who is billed, high-level revenue and cost fields, and key geography.
- Segments — the operational building blocks that describe how an order is physically executed (e.g., linehaul, repositioning, local pickup/delivery segments).
Total Rev: $1,200
Empty Move
(Driver A)
Linehaul
(Driver A)
Delivery
(Driver B)
Conceptually:
- Each Order must have a unique identifier (ORDER_ID) and core commercial attributes (Customer, Bill To, dates, revenue, cost).
- Each Segment must have a unique identifier (SEGMENT_ID) and a link back to its parent Order (e.g., ORDER_ID or equivalent foreign key).
- An Order typically has one or more Segments; together, those segments cover the physical activity and timing of the load from origin to final destination.
2. Data Categories
Fields are grouped into logical Data Categories to make mapping and validation simpler:
- Order / Segment — key identifiers, links, and flags.
- Chronology — dates and times (arrival, departure, appointments).
- Location & Geography — city, state/province, postal code, country, FreightMath Area codes, and related fields.
- Assets (Segments only) — tractors, trailers, drivers, and related attributes.
- Financial — revenue, accessorials, and cost fields used for FreightMath costing.
- Distance — loaded and empty miles used for costing and performance metrics.
3. Required vs. Optional Fields
Each schema field in the Excel workbook is tagged with a REQ flag:
- Y = required — FreightMath expects a valid, non-null value for every record.
- O = optional — useful and ingested when present, but not required for processing.
For implementation planning, prioritize mapping all Y fields first, then expand into optional fields as data quality, availability, and use cases mature.
4. Joining Orders and Segments
The schema assumes a stable, unique Order key with one-to-many related Segment records:
- Every Segment must reference the Order it belongs to.
- Order-level financials (e.g., total revenue) are associated with the Order, while operational activity (e.g., driver, tractor, trailer, miles, timestamps) is associated with Segments.
- FreightMath reconciles Segments to their parent Orders to compute lane-level P&L, network profitability, and driver/asset economics.
5. Time & Location Rules (Chronology & Geography)
To ensure consistent chronology, Segments carry “From” and “To” timestamps and locations. The following business rules apply at a high level:
- Within a Segment, arrival times cannot occur after departure at a given stop.
- Across Segments within a given Order, Segment start times should not overlap in ways that are physically impossible for the same driver or tractor.
- Location fields (city, state, postal code, country) should be valid, parseable, and consistent with the carrier’s TMS and FreightMath’s area definitions.
08:00 - 10:00
10:30 - 14:00
14:15 - 18:00
6. Financial & Distance Fields
Financial fields captured in the schema are used to compute FreightMath’s Operating Ratio (OR), margin, and profitability metrics. At a minimum:
- Revenue and cost fields should be in consistent currency (typically USD).
- Miles fields should distinguish loaded vs. empty mileage where possible.
- Accessorials (detention, layover, stop charges, etc.) should be mapped to their closest FreightMath fields.
For many clients, initial implementations map a subset of financial fields and evolve over time toward full coverage, especially as MapLedger and GL-based costing are introduced.
Tier 2 — Technical Appendix (Field-by-Field Specification)
This appendix mirrors the FreightMath Order and Segment field schema workbooks. It is intended for data engineers and technical implementers who are building or maintaining the TMS → FreightMath integration.
Order Field Specification (Order-Level Schema)
The table below lists all Order-level fields as provided in the ORDER FIELD SCHEMA worksheet, including required flags, FreightMath names, explanations, data types, and data categories.
| REQ | Extract Field Name | FreightMath Field Name | Explanation | Type | Data Category |
|---|---|---|---|---|---|
| Y | ORDER_ID | Order ID | Unique ID for the Customer Order | Text | Order |
| Y | CUSTOMER_ID | Customer ID | Customer that tendered the order | Text | Order |
| Y | CUSTOMER_NAME | Customer Name | Text | Order | |
| Y | BILLTO_ID | Bill To ID | Who will be billed for the Order | Text | Order |
| Y | BILLTO_NAME | Bill To Name | Text | Order | |
| O | BILLTO_TYPE | Bill To Type | Broker, Shipper, Unidentified | Text | Order |
| Y | PICKUP_TYPE | First Pickup Type | Live or Preloaded | Text | Order |
| Y | ORIG_ARRIVE_DTTM | First Pickup Arrival Date and Time | DateTime | Chronology | |
| Y | ORIG_DEPART_DTTM | First Pickup Departure Date and Time | DateTime | Chronology | |
| Y | ORIG_LOC_ID | First Pickup Location ID | Text | Location | |
| Y | ORIG_LOC_NAME | First Pickup Location Name | Text | Location | |
| Y | ORIG_CITY | First Pickup City | Text | Geography | |
| Y | ORIG_STATE_PROVINCE | First Pickup State | Text | Geography | |
| Y | ORIG_POSTAL_CD | First Pickup Postal Code | Text | Geography | |
| Y | ORIG_COUNTRY | First Pickup Country | Text | Geography | |
| O | ORIG_LATITUDE | First Pickup Latitude | Decimal | Geography | |
| O | ORIG_LONGITUDE | First Pickup Longitude | Decimal | Geography | |
| Y | DELIVERY_TYPE | Last Delivery Type | Live or Drop | Text | Order |
| Y | DEST_ARRIVE_DTTM | Last Delivery Arrival Date and Time | DateTime | Chronology | |
| Y | DEST_DEPART_DTTM | Last Delivery Departure Date and Time | DateTime | Chronology | |
| Y | DEST_LOC_ID | Last Delivery Location ID | Text | Location | |
| Y | DEST_LOC_NAME | Last Delivery Location Name | Text | Location | |
| Y | DEST_CITY | Last Delivery City | Text | Geography | |
| Y | DEST_STATE_PROVINCE | Last Delivery State | Text | Geography | |
| Y | DEST_POSTAL_CD | Last Delivery Postal Code | Text | Geography | |
| Y | DEST_COUNTRY | Last Delivery Country | Text | Geography | |
| O | DEST_LATITUDE | Last Delivery Latitude | Decimal | Geography | |
| O | DEST_LONGITUDE | Last Delivery Longitude | Decimal | Geography | |
| Y | BILLABLE_MILES | Order Miles | Billable Miles in your TMS | Decimal | Distance |
| Y | REVENUE_CHARGE_DETAIL | Revenue Charge Details | Code~Qty~Amount|Code~Qty~Amount | Text | Financial |
| Y | ORDER_TOT_REVENUE | Order Total Revenue | Decimal | Financial | |
| Y | ORDER_DIVISION_CD | Order Division Code | Text | Order | |
| O | TOTAL_WEIGHT | Total Weight | Text | Order | |
| Y | BILLABLE_STOP_CT | Billable Stop Count | Used to identify multi-stop Orders | Text | Order |
| O | COMMODITY_CD | Commodity Code | Text | Order | |
| O | OPERATION_TYPE | Operation Type | Asset or Logistics | Text | Order |
| O | TEMP_MIN | Temp Min | Int | Order | |
| O | TEMP_MAX | Temp Max | Int | Order | |
| O | SALES_ID | Sales ID | Text | Order | |
| O | BILLED_DT | Billed Date | DateTime | Order | |
| O | CUSTOM_TEXT1 | Custom Text 1 | Text | Order | |
| O | CUSTOM_TEXT2 | Custom Text 2 | Text | Order | |
| O | CUSTOM_TEXT3 | Custom Text 3 | Text | Order | |
| O | CUSTOM_TEXT4 | Custom Text 4 | Text | Order | |
| O | CUSTOM_TEXT5 | Custom Text 5 | Text | Order | |
| O | CUSTOM_TEXT6 | Custom Text 6 | Text | Order | |
| O | CUSTOM_TEXT7 | Custom Text 7 | Text | Order | |
| O | CUSTOM_TEXT8 | Custom Text 8 | Text | Order | |
| O | CUSTOM_TEXT9 | Custom Text 9 | Text | Order | |
| O | CUSTOM_TEXT10 | Custom Text 10 | Text | Order |
Segment Field Specification (Segment-Level Schema)
The table below lists all Segment-level fields as provided in the SEGMENT FIELD SCHEMA worksheet, including required flags, FreightMath names, explanations, data types, and data categories.
| REQ | Extract Field Name | FreightMath Field Name | Explanation | Type | Data Category |
|---|---|---|---|---|---|
| Y | SEGMENT_ID | Segment ID | Unique ID for each Segment | Int | Segment |
| Y | FROM_EVENT | From Event | What happened at the From Location | Text | Segment |
| Y | FROM_EVENT_TYPE | From Event Type | Pickup, Delivery, or Other | Text | Segment |
| O | FROM_EARLIEST_ARRIVE_DTTM | From Earliest Appointment Date and Time | DateTime | Chronology | |
| Y | FROM_ARRIVE_DTTM | From Arrival Date and Time | DateTime | Chronology | |
| Y | FROM_DEPART_DTTM | From Departure Date and Time | DateTime | Chronology | |
| O | FROM_LATEST_DEPART_DTTM | From Latest Appointment Date and Time | DateTime | Chronology | |
| Y | FOM_LOC_ID | From Location ID | Text | Location | |
| Y | FROM_LOC_NAME | From Location Name | Text | Location | |
| Y | FROM_CITY | From City | Text | Geography | |
| Y | FROM_STATE_PROVINCE | From State | Text | Geography | |
| Y | FROM_POSTAL_CD | From Postal Code | Text | Geography | |
| O | FROM_COUNTRY | From Country | Text | Geography | |
| O | FROM_LATITUDE | From Latitude | Decimal | Geography | |
| O | FROM_LONGITUDE | From Longitude | Decimal | Geography | |
| Y | TO_EVENT | To Event | What happened at the To Location | Text | Segment |
| Y | TO_EVENT_TYPE | To Event Type | Pickup, Delivery, or Other | Text | Segment |
| O | TO_EARLIEST_ARRIVE_DTTM | To Earliest Appointment Date and Time | DateTime | Chronology | |
| Y | TO_ARRIVE_DTTM | To Arrival Date and Time | DateTime | Chronology | |
| Y | TO_DEPART_DTTM | To Departure Date and Time | DateTime | Chronology | |
| O | TO_LATEST_DEPART_DTTM | To Latest Appointment Date and Time | DateTime | Chronology | |
| Y | FOM_LOC_ID | To Location ID | Text | Location | |
| Y | TO_LOC_NAME | To Location Name | Text | Location | |
| Y | TO_CITY | To City | Text | Geography | |
| Y | TO_STATE_PROVINCE | To State | Text | Geography | |
| Y | TO_POSTAL_CD | To Postal Code | Text | Geography | |
| O | TO_COUNTRY | To Country | Text | Geography | |
| O | TO_LATITUDE | To Latitude | Decimal | Geography | |
| O | TO_LONGITUDE | To Longitude | Decimal | Geography | |
| Y | SEGMENT_TMS_MILES | Segment TMS Miles | Decimal | Distance | |
| Y | MILEAGE_TYPE | Mileage Type | Empty or Loaded | Text | Segment |
| Y | SEGMENT_CAPACITY_TYPE | Segment Capacity Type | Single or Team | Text | Assets |
| Y | POWER_ID | Power ID | ID for the Power Unit (Tractor) | Text | Assets |
| Y | POWER_DIVISION_CD | Power Division Code | Text | Assets | |
| Y | TRAILER1_ID | Trailer1 ID | Text | Assets | |
| Y | TRAILER1_TYPE | Trailer1 Type | Text | Assets | |
| O | TRAILER2_ID | Trailer2 ID | Text | Assets | |
| O | TRAILER2_TYPE | Trailer2 Type | Text | Assets | |
| O | TRAILER3_ID | Trailer3 ID | Text | Assets | |
| O | TRAILER3_TYPE | Trailer3 Type | Text | Assets | |
| Y | DRIVER1_ID | Driver ID | Text | Assets | |
| Y | DRIVER1_TYPE | Driver Type | Company, OwnerOperator,Lease, etc. | Text | Assets |
| Y | DRIVER1_DIVISION_CD | Driver Division Code | Text | Assets | |
| O | DRIVER2_ID | Driver2 ID | Text | Assets | |
| O | DRIVER2_TYPE | Driver2 Type | Company, OwnerOperator,Lease, etc. | Text | Assets |
| O | DRIVER2_DIVISION_CD | Driver2 Division Code | Text | Assets | |
| O | TOT_DRIVER_COMP | Total Driver Compensation | Decimal | Financial | |
| Y | CARRIER_ID | Carrier ID | Text | Assets | |
| Y | CARRIER_NAME | Carrier Name | Text | Assets | |
| Y | CARRIER_TOT_PAY | Total Carrier Cost | Decimal | Financial | |
| Y | ASSIGNED_ORDER_ID | Assigned Order ID | Which Order ID is this Segment associated with | Text | Segment |
| O | TOT_WEIGHT | Total Weight | Text | Segment | |
| O | DISPATCHER_ID | Dispatcher ID | Text | Segment | |
| O | PLANNER_ID | Planner ID | Text | Segment | |
| O | CUSTOM_TEXT1 | Custom Text 1 | Text | Segment | |
| O | CUSTOM_TEXT2 | Custom Text 2 | Text | Segment | |
| O | CUSTOM_TEXT3 | Custom Text 3 | Text | Segment | |
| O | CUSTOM_TEXT4 | Custom Text 4 | Text | Segment | |
| O | CUSTOM_TEXT5 | Custom Text 5 | Text | Segment | |
| O | CUSTOM_TEXT6 | Custom Text 6 | Text | Segment | |
| O | CUSTOM_TEXT7 | Custom Text 7 | Text | Segment | |
| O | CUSTOM_TEXT8 | Custom Text 8 | Text | Segment | |
| O | CUSTOM_TEXT9 | Custom Text 9 | Text | Segment | |
| O | CUSTOM_TEXT10 | Custom Text 10 | Text | Segment |
TMS-Specific Mapping Guides
The core FreightMath Data Schema is TMS-agnostic. However, most clients prefer prescriptive, system-specific guidance. The following sections are reserved for detailed mapping patterns, code snippets, and export templates for major TMS platforms. These will be maintained as separate Knowledge Base pages, with links surfaced here.
McLeod
McLeod Guide: View McLeod Instructions
Status: Final content will include:
- Recommended McLeod report(s) or data extracts for Orders and Segments.
- Field-by-field mapping from McLeod names to FreightMath schema.
- Example SQL/SSRS or API extract logic.
- Sample transformation script (e.g., Python or SQL) that outputs the CSV formats above.
TMW
Status: Final content will include:
- Recommended TMW tables/views for Orders and Movements.
- Join keys and logic to derive Segments from TMW events.
- Example stored procedures or exports to the FreightMath CSV layout.
Innovative / AS400
Innovative Guide: View Innovative Instructions
Status: Final content will include:
- Standard Innovative/AS400 files and screens used to source Orders and Segments.
- Logic for translating trip/leg structures into FreightMath segments.
- Example ETL pattern for nightly CSV or database pushes.
Alvys
Status: Final content will include:
- API endpoints and webhooks recommended for Order/Segment data.
- JSON-to-CSV transformation patterns into the FreightMath schema.
- Authentication and paging considerations for production feeds.
Truckmate
Status: Final content will include:
- Key Truckmate tables, extracts, or APIs used to derive Orders and Segments.
- Mapping of Truckmate trip/leg constructs to FreightMath segments.
- Example scripts or SSIS packages that output FreightMath-ready CSVs.
Note: Separate Knowledge Base pages will provide TMS-specific mapping examples (e.g., McLeod, TMW, MercuryGate, etc.), including code snippets and ETL patterns that map native TMS fields into this FreightMath Data Schema.