{
 "type": "object",
 "properties": {
  "accessorials": {
   "type": "object",
   "properties": {
    "appointmentDetails": {
     "type": "object",
     "properties": {
      "delivery": {
       "type": "object",
       "properties": {
        "end": {
         "type": "string",
         "pattern": "\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}(?::\\d{2}(?:[.]\\d{3})?)?)?"
        },
        "start": {
         "type": "string",
         "pattern": "\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}(?::\\d{2}(?:[.]\\d{3})?)?)?"
        }
       }
      },
      "pickup": {
       "type": "object",
       "properties": {
        "end": {
         "type": "string",
         "pattern": "\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}(?::\\d{2}(?:[.]\\d{3})?)?)?"
        },
        "start": {
         "type": "string",
         "pattern": "\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}(?::\\d{2}(?:[.]\\d{3})?)?)?"
        }
       }
      }
     }
    },
    "cod": {
     "type": "object",
     "properties": {
      "amount": {
       "type": "string",
       "pattern": "\\d+.\\d{2}"
      },
      "remitTo": {
       "type": "object",
       "properties": {
        "address1": {
         "type": "string"
        },
        "city": {
         "type": "string"
        },
        "name": {
         "type": "string"
        },
        "postalCode": {
         "type": "string",
         "pattern": "(?:\\d{5}(?:[-]\\d{4})?)|(?:(?:[A-Za-z][0-9][A-Za-z][0-9][A-Za-z])[0-9]?)"
        },
        "stateProvince": {
         "enum": [
          "AL",
          "AK",
          "AZ",
          "AR",
          "CA",
          "CO",
          "CT",
          "DC",
          "DE",
          "FL",
          "GA",
          "HI",
          "ID",
          "IL",
          "IN",
          "IA",
          "KS",
          "KY",
          "LA",
          "ME",
          "MD",
          "MA",
          "MI",
          "MN",
          "MS",
          "MO",
          "MT",
          "NE",
          "NV",
          "NH",
          "NJ",
          "NM",
          "NY",
          "NC",
          "ND",
          "OH",
          "OK",
          "OR",
          "PA",
          "PR",
          "RI",
          "SC",
          "SD",
          "TN",
          "TX",
          "UT",
          "VT",
          "VA",
          "WA",
          "WV",
          "WI",
          "WY",
          "AB",
          "BC",
          "MB",
          "NB",
          "NL",
          "NS",
          "NT",
          "NU",
          "ON",
          "PE",
          "QC",
          "SK",
          "YT",
          "CMX",
          "AGU",
          "BCN",
          "BCS",
          "CAM",
          "COA",
          "COL",
          "CHP",
          "CHH",
          "DUR",
          "GUA",
          "GRO",
          "HID",
          "JAL",
          "MEX",
          "MIC",
          "MOR",
          "NAY",
          "NLE",
          "OAX",
          "PUE",
          "QUE",
          "ROO",
          "SLP",
          "SIN",
          "SON",
          "TAB",
          "TAM",
          "TLA",
          "VER",
          "YUC",
          "ZAC"
         ]
        }
       },
       "required": [
        "address1",
        "city",
        "name",
        "postalCode",
        "stateProvince"
       ]
      }
     },
     "required": [
      "amount",
      "remitTo"
     ]
    },
    "codes": {
     "type": "array",
     "items": {
      "enum": [
       "AIRDE",
       "AIRPU",
       "APPT",
       "HAZMAT",
       "INSIDE",
       "INSPU",
       "LIFTDC",
       "LIFTDP",
       "LIFTPP",
       "LADE",
       "LONG8",
       "LONG12",
       "LONG16",
       "LONG20",
       "NOTIFY",
       "RES",
       "SADE",
       "SEG",
       "HAZ",
       "IDL",
       "IPU"
      ]
     }
    },
    "fullValueCoverageDetails": {
     "type": "object",
     "properties": {
      "monetaryValue": {
       "type": "string",
       "pattern": "\\d+.\\d{2}"
      }
     },
     "required": [
      "monetaryValue"
     ]
    },
    "hazardousDetails": {
     "type": "object",
     "properties": {
      "emergencyContact": {
       "type": "object",
       "properties": {
        "phone": {
         "type": "string"
        }
       },
       "required": [
        "phone"
       ]
      }
     },
     "required": [
      "emergencyContact"
     ]
    }
   }
  },
  "billTo": {
   "type": "object",
   "properties": {
    "account": {
     "type": "string"
    },
    "address1": {
     "type": "string"
    },
    "address2": {
     "type": "string"
    },
    "city": {
     "type": "string"
    },
    "contact": {
     "type": "object",
     "properties": {
      "email": {
       "type": "string"
      },
      "name": {
       "type": "string"
      },
      "phone": {
       "type": "string"
      },
      "phoneExt": {
       "type": "string"
      }
     },
     "required": [
      "phone"
     ]
    },
    "name": {
     "type": "string"
    },
    "postalCode": {
     "type": "string",
     "pattern": "(?:\\d{5}(?:[-]\\d{4})?)|(?:(?:[A-Za-z][0-9][A-Za-z][0-9][A-Za-z])[0-9]?)"
    },
    "stateProvince": {
     "enum": [
      "AL",
      "AK",
      "AZ",
      "AR",
      "CA",
      "CO",
      "CT",
      "DC",
      "DE",
      "FL",
      "GA",
      "HI",
      "ID",
      "IL",
      "IN",
      "IA",
      "KS",
      "KY",
      "LA",
      "ME",
      "MD",
      "MA",
      "MI",
      "MN",
      "MS",
      "MO",
      "MT",
      "NE",
      "NV",
      "NH",
      "NJ",
      "NM",
      "NY",
      "NC",
      "ND",
      "OH",
      "OK",
      "OR",
      "PA",
      "PR",
      "RI",
      "SC",
      "SD",
      "TN",
      "TX",
      "UT",
      "VT",
      "VA",
      "WA",
      "WV",
      "WI",
      "WY",
      "AB",
      "BC",
      "MB",
      "NB",
      "NL",
      "NS",
      "NT",
      "NU",
      "ON",
      "PE",
      "QC",
      "SK",
      "YT",
      "CMX",
      "AGU",
      "BCN",
      "BCS",
      "CAM",
      "COA",
      "COL",
      "CHP",
      "CHH",
      "DUR",
      "GUA",
      "GRO",
      "HID",
      "JAL",
      "MEX",
      "MIC",
      "MOR",
      "NAY",
      "NLE",
      "OAX",
      "PUE",
      "QUE",
      "ROO",
      "SLP",
      "SIN",
      "SON",
      "TAB",
      "TAM",
      "TLA",
      "VER",
      "YUC",
      "ZAC"
     ]
    }
   },
   "required": [
    "address1",
    "city",
    "contact",
    "name",
    "postalCode",
    "stateProvince"
   ]
  },
  "bol": {
   "type": "object",
   "properties": {
    "function": {
     "enum": [
      "Create",
      "Modify"
     ]
    },
    "isTest": {
     "type": "boolean"
    },
    "requestedPickupDate": {
     "type": "string",
     "pattern": "\\d{4}-\\d{2}-\\d{2}"
    },
    "requestorRole": {
     "enum": [
      "Shipper",
      "Consignee",
      "BillTo",
      "S",
      "C",
      "B"
     ]
    },
    "specialInstructions": {
     "type": "string"
    }
   },
   "required": [
    "function",
    "requestedPickupDate",
    "requestorRole"
   ]
  },
  "commodities": {
   "type": "object",
   "properties": {
    "handlingUnits": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "count": {
        "type": "integer"
       },
       "lineItems": {
        "type": "array",
        "items": {
         "type": "object",
         "properties": {
          "classification": {
           "enum": [
            "50",
            "55",
            "60",
            "65",
            "70",
            "77.5",
            "85",
            "92.5",
            "100",
            "110",
            "125",
            "150",
            "175",
            "200",
            "250",
            "300",
            "400",
            "500"
           ]
          },
          "description": {
           "type": "string"
          },
          "hazardous": {
           "type": "boolean"
          },
          "nmfc": {
           "type": "string",
           "pattern": "\\d+"
          },
          "pieces": {
           "type": "integer"
          },
          "weight": {
           "type": "integer"
          }
         },
         "required": [
          "classification",
          "description",
          "nmfc",
          "pieces",
          "weight"
         ]
        }
       },
       "type": {
        "enum:": [
         "PT",
         "BG",
         "BL",
         "BX",
         "BD",
         "CT",
         "CS",
         "CR",
         "DR",
         "LS",
         "PL",
         "PC",
         "RE",
         "RL",
         "SK",
         "TK",
         "TB",
         "Bins",
         "BAG",
         "BAL",
         "BOX",
         "BDL",
         "CTN",
         "CAS",
         "CRT",
         "DRM",
         "PAL",
         "PCS",
         "REL",
         "ROL",
         "SKD",
         "TNK",
         "TBN"
        ]
       },
       "weight": {
        "type": "integer"
       }
      },
      "required": [
       "count",
       "type"
      ]
     }
    }
   },
   "required": [
    "handlingUnits"
   ]
  },
  "destination": {
   "type": "object",
   "properties": {
    "account": {
     "type": "string"
    },
    "address1": {
     "type": "string"
    },
    "address2": {
     "type": "string"
    },
    "city": {
     "type": "string"
    },
    "contact": {
     "type": "object",
     "properties": {
      "email": {
       "type": "string"
      },
      "name": {
       "type": "string"
      },
      "phone": {
       "type": "string"
      },
      "phoneExt": {
       "type": "string"
      }
     },
     "required": [
      "phone"
     ]
    },
    "name": {
     "type": "string"
    },
    "postalCode": {
     "type": "string",
     "pattern": "(?:\\d{5}(?:[-]\\d{4})?)|(?:(?:[A-Za-z][0-9][A-Za-z][0-9][A-Za-z])[0-9]?)"
    },
    "stateProvince": {
     "enum": [
      "AL",
      "AK",
      "AZ",
      "AR",
      "CA",
      "CO",
      "CT",
      "DC",
      "DE",
      "FL",
      "GA",
      "HI",
      "ID",
      "IL",
      "IN",
      "IA",
      "KS",
      "KY",
      "LA",
      "ME",
      "MD",
      "MA",
      "MI",
      "MN",
      "MS",
      "MO",
      "MT",
      "NE",
      "NV",
      "NH",
      "NJ",
      "NM",
      "NY",
      "NC",
      "ND",
      "OH",
      "OK",
      "OR",
      "PA",
      "PR",
      "RI",
      "SC",
      "SD",
      "TN",
      "TX",
      "UT",
      "VT",
      "VA",
      "WA",
      "WV",
      "WI",
      "WY",
      "AB",
      "BC",
      "MB",
      "NB",
      "NL",
      "NS",
      "NT",
      "NU",
      "ON",
      "PE",
      "QC",
      "SK",
      "YT",
      "CMX",
      "AGU",
      "BCN",
      "BCS",
      "CAM",
      "COA",
      "COL",
      "CHP",
      "CHH",
      "DUR",
      "GUA",
      "GRO",
      "HID",
      "JAL",
      "MEX",
      "MIC",
      "MOR",
      "NAY",
      "NLE",
      "OAX",
      "PUE",
      "QUE",
      "ROO",
      "SLP",
      "SIN",
      "SON",
      "TAB",
      "TAM",
      "TLA",
      "VER",
      "YUC",
      "ZAC"
     ]
    }
   },
   "required": [
    "address1",
    "city",
    "contact",
    "name",
    "postalCode",
    "stateProvince"
   ]
  },
  "origin": {
   "type": "object",
   "properties": {
    "account": {
     "type": "string"
    },
    "address1": {
     "type": "string"
    },
    "address2": {
     "type": "string"
    },
    "city": {
     "type": "string"
    },
    "contact": {
     "type": "object",
     "properties": {
      "email": {
       "type": "string"
      },
      "name": {
       "type": "string"
      },
      "phone": {
       "type": "string"
      },
      "phoneExt": {
       "type": "string"
      }
     },
     "required": [
      "phone"
     ]
    },
    "name": {
     "type": "string"
    },
    "postalCode": {
     "type": "string",
     "pattern": "(?:\\d{5}(?:[-]\\d{4})?)|(?:(?:[A-Za-z][0-9][A-Za-z][0-9][A-Za-z])[0-9]?)"
    },
    "stateProvince": {
     "enum": [
      "AL",
      "AK",
      "AZ",
      "AR",
      "CA",
      "CO",
      "CT",
      "DC",
      "DE",
      "FL",
      "GA",
      "HI",
      "ID",
      "IL",
      "IN",
      "IA",
      "KS",
      "KY",
      "LA",
      "ME",
      "MD",
      "MA",
      "MI",
      "MN",
      "MS",
      "MO",
      "MT",
      "NE",
      "NV",
      "NH",
      "NJ",
      "NM",
      "NY",
      "NC",
      "ND",
      "OH",
      "OK",
      "OR",
      "PA",
      "PR",
      "RI",
      "SC",
      "SD",
      "TN",
      "TX",
      "UT",
      "VT",
      "VA",
      "WA",
      "WV",
      "WI",
      "WY",
      "AB",
      "BC",
      "MB",
      "NB",
      "NL",
      "NS",
      "NT",
      "NU",
      "ON",
      "PE",
      "QC",
      "SK",
      "YT",
      "CMX",
      "AGU",
      "BCN",
      "BCS",
      "CAM",
      "COA",
      "COL",
      "CHP",
      "CHH",
      "DUR",
      "GUA",
      "GRO",
      "HID",
      "JAL",
      "MEX",
      "MIC",
      "MOR",
      "NAY",
      "NLE",
      "OAX",
      "PUE",
      "QUE",
      "ROO",
      "SLP",
      "SIN",
      "SON",
      "TAB",
      "TAM",
      "TLA",
      "VER",
      "YUC",
      "ZAC"
     ]
    }
   },
   "required": [
    "address1",
    "city",
    "contact",
    "name",
    "postalCode",
    "stateProvince"
   ]
  },
  "payment": {
   "type": "object",
   "properties": {
    "terms": {
     "enum": [
      "Prepaid",
      "Collect"
     ]
    }
   },
   "required": [
    "terms"
   ]
  },
  "referenceNumbers": {
   "type": "object",
   "properties": {
    "bol": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "masterBol": {
     "type": "string"
    },
    "po": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "number": {
        "type": "string"
       }
      },
      "required": [
       "number"
      ]
     }
    },
    "pro": {
     "type": "string"
    },
    "shipmentId": {
     "type": "string"
    }
   },
   "required": []
  },
  "version": {
   "enum": [
    "2.1.0"
   ]
  }
 },
 "required": [
  "bol",
  "commodities",
  "destination",
  "origin",
  "payment",
  "version"
 ]
}