{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bitfreighter/json-schema/bitfreighter-internal-rate-request-schema-schema.json",
  "title": "Internal Rate Request Schema",
  "description": "Defines the necessary information to request a rate for a shipment.",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bitfreighter-openapi.yml#/components/schemas/Internal Rate Request Schema",
  "properties": {
    "accessorials": {
      "description": "An array of additional services requested for the shipment",
      "items": {
        "additionalProperties": false,
        "description": "Additional services requested for the shipment",
        "enum": [
          "drydraught",
          "hazardous",
          "hotshot",
          "insurance",
          "liftgate",
          "lowboy",
          "pallet jack",
          "plated trailer",
          "safe transport of food",
          "stepdeck",
          "straps",
          "tanker endorsement",
          "tarps",
          "team drivers",
          "conestoga",
          "hotshot",
          "curtainside",
          "expedited",
          "premium",
          "pick or drop trailer"
        ],
        "title": "Accessorials",
        "type": "string"
      },
      "type": "array"
    },
    "buy_it_now_price": {
      "description": "The rate in USD a carrier may accept for instant booking",
      "type": "number"
    },
    "comments": {
      "description": "Free text comments or notes on the shipment. Use only for data that does not fit elsewhere in the schema",
      "type": "string"
    },
    "equipment": {
      "description": "An array of equipment types that could be used for delivering the shipment",
      "items": {
        "additionalProperties": false,
        "description": "An equipment type that could be used for delivering the shipment",
        "enum": [
          "van",
          "reefer",
          "flatbed"
        ],
        "required": true,
        "title": "RateEquipment",
        "type": "string"
      },
      "type": "array"
    },
    "external_load_reference_id": {
      "description": "A unique identifier for the load. This is useful for helping identify what requests are tied to a particular load.",
      "type": "string"
    },
    "external_reference_id": {
      "description": "A unique identifier for the web request - helpful for debugging with the API caller",
      "type": "string"
    },
    "is_all_in": {
      "description": "If true, Bitfreighter will return an all in rate with fuel costs included. Otherwise, Bitfreighter will return the line haul rate",
      "type": "boolean"
    },
    "mode": {
      "description": "The transportation mode requested for the shipment",
      "enum": [
        "truckload",
        "ltl",
        "airfreight",
        "rail"
      ],
      "type": "string"
    },
    "shipper_identifier": {
      "description": "unique identifier for the shipper",
      "type": "string"
    },
    "stops": {
      "description": "An array of stops for the shipment",
      "items": {
        "description": "Stop information for a real time rating request",
        "properties": {
          "comments": {
            "description": "Free text comments or notes about the stop. Use only for data that does not fit elsewhere in the schema",
            "type": [
              "string",
              "null"
            ]
          },
          "location": {
            "properties": {
              "address": {
                "description": "The address of the stop",
                "nullable": false,
                "properties": {
                  "city": {
                    "description": "Free-form text for city name",
                    "maxLength": 30,
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "country": {
                    "description": "Code identifying the country",
                    "enum": [
                      "US",
                      "CA",
                      "MX",
                      "IN",
                      "USA",
                      "CAN",
                      "MEX",
                      "IND"
                    ],
                    "title": "NACountry2or3",
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "line1": {
                    "description": "FlexAddress Line 1",
                    "maxLength": 55,
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "line2": {
                    "description": "FlexAddress Line 2",
                    "maxLength": 55,
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "postal_code": {
                    "description": "Code specifying international postal zone code excluding punctuation and blanks (zip code for United States)",
                    "maxLength": 15,
                    "minLength": 3,
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "state": {
                    "description": "Code specifying the Standard State/Province as defined by appropriate government agency. 2 chars for US/Canada (ISO 3166-2:US/CA), 3 chars for Mexico (ISO 3166-2:MX).",
                    "maxLength": 3,
                    "minLength": 2,
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "postal_code",
                  "country"
                ],
                "title": "FlexAddress",
                "type": "object"
              },
              "latitude": {
                "description": "The latitude of the address",
                "type": [
                  "number",
                  "null"
                ]
              },
              "longitude": {
                "description": "The longitude of the address",
                "type": [
                  "number",
                  "null"
                ]
              },
              "name": {
                "description": "The name of the facility or location",
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "address"
            ],
            "type": "object"
          },
          "reason": {
            "description": "The type of stop",
            "enum": [
              "load",
              "unload",
              "pick_trailer",
              "drop_trailer"
            ],
            "type": [
              "string",
              "null"
            ]
          },
          "scheduled_at": {
            "description": "Date/Time as ISO8601 formatted string. This should be in UTC time. This is required for the first stop.",
            "format": "date-time",
            "title": "DateTime",
            "type": [
              "string",
              "null"
            ]
          },
          "sequence_number": {
            "description": "Identifying number for the specific stop and the sequence in which the stop is to be performed",
            "maximum": 999,
            "minimum": 1,
            "title": "SequenceNumber",
            "type": "integer"
          }
        },
        "required": [
          "sequence_number",
          "location"
        ],
        "title": "RateRequestStop",
        "type": "object"
      },
      "type": "array"
    },
    "total_cargo_value": {
      "description": "The sum total value of all cargo in the shipment. USD only.",
      "type": "number"
    },
    "total_distance": {
      "description": "The total distance of the shipment",
      "properties": {
        "unit_of_measure": {
          "description": "The unit of measure for the distance",
          "enum": [
            "mi",
            "ki"
          ],
          "type": "string"
        },
        "value": {
          "description": "The total distance of the shipment",
          "type": "number"
        }
      },
      "required": [
        "value",
        "unit_of_measure"
      ],
      "type": "object"
    },
    "total_volume": {
      "description": "The total volume of the shipment",
      "properties": {
        "unit_of_measure": {
          "description": "The unit of measure for the volume",
          "enum": [
            "cubic_feet",
            "cubic_meters"
          ],
          "type": "string"
        },
        "value": {
          "description": "The total volume of the shipment",
          "type": "number"
        }
      },
      "required": [
        "value",
        "unit_of_measure"
      ],
      "type": "object"
    },
    "total_weight": {
      "description": "The total weight of the shipment",
      "properties": {
        "unit_of_measure": {
          "description": "The unit of measure for the weight",
          "enum": [
            "lbs",
            "kg"
          ],
          "type": "string"
        },
        "value": {
          "description": "The total weight of the shipment",
          "type": "number"
        }
      },
      "required": [
        "value",
        "unit_of_measure"
      ],
      "type": "object"
    }
  },
  "required": [
    "external_reference_id",
    "stops",
    "mode",
    "is_all_in",
    "equipment",
    "shipper_identifier"
  ],
  "type": "object"
}