{
 "type": "object",
 "properties": {
  "accessorials": {
   "type": "object",
   "properties": {
    "appointmentDetails": {
     "type": "object",
     "properties": {
      "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}"
      },
      "currency": {
       "enum": [
        "USD",
        "CAD",
        "MXN"
       ]
      },
      "customerCheckAcceptable": {
       "enum": [
        "Personal",
        "Certified",
        "Cashiers",
        "Money Order"
       ]
      },
      "remitTo": {
       "type": "object",
       "properties": {
        "address1": {
         "type": "string"
        },
        "address2": {
         "type": "string"
        },
        "city": {
         "type": "string"
        },
        "country": {
         "enum": [
          "USA",
          "CAN",
          "MEX"
         ]
        },
        "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"
         ]
        }
       }
      },
      "terms": {
       "enum": [
        "Prepaid",
        "Collect"
       ]
      }
     },
     "required": [
      "amount",
      "customerCheckAcceptable",
      "remitTo",
      "terms"
     ]
    },
    "codes": {
     "type": "array",
     "items": {
      "enum": [
       "IDL",
       "IPU",
       "LFTD",
       "LFTP",
       "PSC",
       "REP",
       "RES",
       "DCF",
       "DID",
       "DLG",
       "DNC",
       "DSH",
       "DST",
       "GUR",
       "OCF",
       "OIP",
       "OLG",
       "PFF",
       "RSD",
       "RSO"
      ]
     }
    }
   }
  },
  "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"
     ]
    },
    "country": {
     "enum": [
      "USA",
      "CAN",
      "MEX"
     ]
    },
    "locationId": {
     "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",
    "contact",
    "country",
    "name",
    "postalCode",
    "stateProvince"
   ]
  },
  "bol": {
   "type": "object",
   "properties": {
    "function": {
     "enum": [
      "Create"
     ]
    },
    "isTest": {
     "type": "boolean"
    },
    "requestedPickupDate": {
     "type": "string",
     "pattern": "\\d{4}-\\d{2}-\\d{2}"
    },
    "requestorRole": {
     "enum": [
      "Shipper",
      "Consignee",
      "Third Party"
     ]
    },
    "specialInstructions": {
     "type": "string"
    }
   },
   "required": [
    "function",
    "requestedPickupDate",
    "requestorRole"
   ]
  },
  "commodities": {
   "type": "object",
   "properties": {
    "handlingUnits": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "dimensionsUnit": {
        "enum": [
         "Inches",
         "Centimeters"
        ]
       },
       "height": {
        "type": "integer"
       },
       "length": {
        "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+"
          },
          "packagingType": {
           "enum:": [
            "CTN",
            "PLT",
            "PCS",
            "SKD",
            "BAG",
            "BAL",
            "BBL",
            "BDL",
            "BIN",
            "BOX",
            "BSK",
            "BTL",
            "BXT",
            "CAB",
            "CAG",
            "CAN",
            "CAS",
            "CBY",
            "CHS",
            "CNT",
            "COL",
            "CRT",
            "CYL",
            "DRM",
            "ENV",
            "FRM",
            "IBC",
            "JAR",
            "JER",
            "JUG",
            "KEG",
            "KIT",
            "LSE",
            "MSC",
            "PAL",
            "PKG",
            "PLF",
            "RCK",
            "REL",
            "ROL",
            "SAK",
            "SLV",
            "SPL",
            "TBE",
            "TBN",
            "TNK",
            "TRY",
            "TUB",
            "INT",
            "JCN",
            "PAT"
           ]
          },
          "pieces": {
           "type": "integer"
          },
          "weight": {
           "type": "integer"
          },
          "weightUnit": {
           "enum": [
            "Pounds",
            "Kilograms"
           ]
          }
         },
         "required": [
          "classification",
          "description",
          "packagingType",
          "pieces",
          "weight"
         ]
        }
       },
       "tareWeight": {
        "type": "integer"
       },
       "weight": {
        "type": "integer"
       },
       "weightUnit": {
        "enum": [
         "Pounds",
         "Kilograms"
        ]
       },
       "width": {
        "type": "integer"
       }
      },
      "required": [
       "lineItems"
      ]
     }
    }
   },
   "required": [
    "handlingUnits"
   ]
  },
  "customsBroker": {
   "type": "object",
   "properties": {
    "type": {
     "enum": [
      "Import",
      "Export"
     ]
    },
    "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"
     ]
    },
    "country": {
     "enum": [
      "USA",
      "CAN",
      "MEX"
     ]
    },
    "locationId": {
     "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": []
  },
  "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"
     ]
    },
    "country": {
     "enum": [
      "USA",
      "CAN",
      "MEX"
     ]
    },
    "locationId": {
     "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",
    "contact",
    "country",
    "name",
    "postalCode",
    "stateProvince"
   ]
  },
  "images": {
   "type": "object",
   "properties": {
    "email": {
     "type": "object",
     "properties": {
      "addresses": {
       "type": "array",
       "items": {
        "type": "string"
       }
      },
      "includeBol": {
       "type": "boolean"
      }
     },
     "required": [
      "addresses"
     ]
    }
   },
   "required": [
    "email"
   ]
  },
  "notifications": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "email": {
      "type": "string"
     },
     "phoneNumber": {
      "type": "string"
     }
    }
   }
  },
  "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"
     ]
    },
    "country": {
     "enum": [
      "USA",
      "CAN",
      "MEX"
     ]
    },
    "locationId": {
     "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",
    "contact",
    "country",
    "name",
    "postalCode",
    "stateProvince"
   ]
  },
  "referenceNumbers": {
   "type": "object",
   "properties": {
    "additionalReferences": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "name": {
        "enum": [
         "shippersRefNbr"
        ]
       },
       "value": {
        "type": "string"
       }
      },
      "required": [
       "name",
       "value"
      ]
     }
    },
    "bol": {
     "type": "array",
     "items": {
      "type": "string"
     }
    },
    "po": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "additionalShipperInfo": {
        "type": "string"
       },
       "number": {
        "type": "string"
       },
       "palletized": {
        "type": "boolean"
       },
       "pieces": {
        "type": "integer"
       },
       "weight": {
        "type": "integer"
       },
       "weightUnit": {
        "enum": [
         "Pounds",
         "Kilograms"
        ]
       }
      }
     }
    },
    "pro": {
     "type": "string"
    }
   },
   "required": [
    "po",
    "pro"
   ]
  },
  "shipmentTotals": {
   "type": "object",
   "properties": {
    "cube": {
     "type": "integer"
    },
    "cubeDimensionsUnit": {
     "enum": [
      "Feet",
      "Meters"
     ]
    },
    "currency": {
     "enum": [
      "USD",
      "CAD",
      "MXN"
     ]
    },
    "declaredValue": {
     "type": "integer"
    },
    "dimensionsUnit": {
     "enum": [
      "Inches",
      "Centimeters"
     ]
    },
    "grossWeight": {
     "type": "integer"
    },
    "handlingUnits": {
     "type": "integer"
    },
    "linearLength": {
     "type": "integer"
    },
    "netWeight": {
     "type": "integer"
    },
    "weightUnit": {
     "enum": [
      "Pounds",
      "Kilograms"
     ]
    }
   }
  },
  "version": {
   "enum": [
    "2.1.0"
   ]
  }
 },
 "required": [
  "billTo",
  "bol",
  "commodities",
  "destination",
  "origin",
  "version"
 ]
}