{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bitfreighter/json-schema/bitfreighter-spot-load-create-or-update-schema-schema.json",
  "title": "Spot Load Create or Update Schema",
  "description": "Defines the necessary information to post a new or updated spot load.",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bitfreighter-openapi.yml#/components/schemas/Spot Load Create or Update Schema",
  "oneOf": [
    {
      "description": "Defines the necessary information to post a single spot load.",
      "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",
            "null"
          ]
        },
        "auction_end": {
          "description": "Date/Time as ISO8601 formatted string in UTC. This marks the end of a timed auction.",
          "format": "date-time",
          "title": "DateTime",
          "type": [
            "string",
            "null"
          ]
        },
        "buy_it_now_price": {
          "description": "The rate in USD a carrier may accept for instant booking",
          "type": [
            "number",
            "null"
          ]
        },
        "comments": {
          "description": "Free text comments or notes on the shipment. Use only for data that does not fit elsewhere in the schema",
          "type": [
            "string",
            "null"
          ]
        },
        "equipment": {
          "description": "A comma-separated list of valid equipment types for the load",
          "type": "string"
        },
        "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",
            "null"
          ]
        },
        "external_reference_id": {
          "description": "A unique identifier for the auction",
          "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"
        },
        "items": {
          "description": "Items included in the shipment. Supply either volume or length and width.",
          "items": {
            "description": "Items contained in the shipment or load",
            "properties": {
              "height": {
                "description": "The height of the item",
                "properties": {
                  "unit_of_measure": {
                    "default": "feet",
                    "description": "The unit of measure for the height",
                    "enum": [
                      "inches",
                      "feet",
                      "meters"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "The height",
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "value",
                  "unit_of_measure"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "length": {
                "description": "The length of the item",
                "properties": {
                  "unit_of_measure": {
                    "default": "feet",
                    "description": "The unit of measure for the length",
                    "enum": [
                      "inches",
                      "feet",
                      "meters"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "The length",
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "value",
                  "unit_of_measure"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "name": {
                "description": "A short name or description of the item",
                "type": [
                  "string",
                  "null"
                ]
              },
              "quantity": {
                "description": "How many items with these dimensions are in the load",
                "type": [
                  "integer",
                  "null"
                ]
              },
              "volume": {
                "description": "The volume of the item",
                "properties": {
                  "unit_of_measure": {
                    "default": "cubic_feet",
                    "description": "The unit of measure for the volume",
                    "enum": [
                      "cubic_inches",
                      "cubic_feet",
                      "cubic_meters"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "The volume",
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "value",
                  "unit_of_measure"
                ],
                "type": [
                  "object",
                  "null"
                ]
              },
              "width": {
                "description": "The width of the item",
                "properties": {
                  "unit_of_measure": {
                    "default": "feet",
                    "description": "The unit of measure for the width",
                    "enum": [
                      "inches",
                      "feet",
                      "meters"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "The width",
                    "type": [
                      "number",
                      "null"
                    ]
                  }
                },
                "required": [
                  "value",
                  "unit_of_measure"
                ],
                "type": [
                  "object",
                  "null"
                ]
              }
            },
            "required": [
              "quantity"
            ],
            "title": "SpotLoadItem",
            "type": "object"
          },
          "type": [
            "array",
            "null"
          ]
        },
        "lowest_known_offer": {
          "description": "The rate in USD of the lowest known bid or offer.",
          "type": [
            "number",
            "null"
          ]
        },
        "min_temperature": {
          "description": "The lowest temperature the shipment must be kept at",
          "properties": {
            "unit_of_measure": {
              "description": "The unit of measure for the temperature",
              "enum": [
                "fahrenheit",
                "celsius"
              ],
              "type": "string"
            },
            "value": {
              "description": "The lowest temperature the shipment must be kept at",
              "type": "number"
            }
          },
          "required": [
            "value",
            "unit_of_measure"
          ],
          "type": [
            "object",
            "null"
          ]
        },
        "mode": {
          "description": "The transportation mode requested for the shipment",
          "enum": [
            "truckload",
            "ltl",
            "airfreight",
            "rail",
            "unknown"
          ],
          "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 spot load",
            "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. Country is required. Provide either City + State or Postal Code in addition to Country.",
                    "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": [
                      "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": "SpotLoadStop",
            "type": "object"
          },
          "type": "array"
        },
        "total_cargo_value": {
          "description": "The sum total value of all cargo in the shipment. USD only.",
          "type": [
            "number",
            "null"
          ]
        },
        "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",
            "null"
          ]
        },
        "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",
            "null"
          ]
        },
        "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",
            "null"
          ]
        }
      },
      "required": [
        "external_reference_id",
        "stops",
        "mode",
        "is_all_in",
        "equipment",
        "shipper_identifier"
      ],
      "title": "Spot Load Schema",
      "type": "object"
    },
    {
      "description": "Indicates the current status of a spot load.",
      "properties": {
        "external_reference_id": {
          "description": "A unique identifier for the web request - helpful for debugging with the API caller",
          "type": "string"
        },
        "status": {
          "description": "The current status of the spot load.",
          "enum": [
            "pending",
            "cancelled",
            "won",
            "lost",
            "ended"
          ],
          "type": "string"
        }
      },
      "required": [
        "external_reference_id",
        "status"
      ],
      "title": "Spot Load Status Update Schema",
      "type": "object"
    }
  ],
  "type": "object"
}