{
 "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})?)?"
        }
       }
      }
     }
    },
    "timeCriticalDetails": {
     "type": "object",
     "properties": {
      "date": {
       "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})?)?"
        }
       }
      }
     },
     "required": [
      "date"
     ]
    },
    "codes": {
     "type": "array",
     "items": {
      "enum": [
       "APTD",
       "APTP",
       "COD",
       "EXPD",
       "FVC",
       "GTD_AM",
       "GTD_NOON",
       "GTD_PM",
       "HAZ",
       "IDL",
       "INBD",
       "IPU",
       "LFTD",
       "LFTP",
       "LTDAD",
       "LTDAP",
       "MARK",
       "MNC",
       "OVR",
       "PPD",
       "PSC",
       "PSH",
       "PSN",
       "REP",
       "RES",
       "SRT",
       "SS",
       "TCS"
      ]
     }
    }
   }
  },
  "billTo": {
   "type": "object",
   "properties": {
    "contact": {
     "type": "object",
     "properties": {
      "email": {
       "type": "string"
      },
      "name": {
       "type": "string"
      },
      "phone": {
       "type": "string"
      },
      "phoneExt": {
       "type": "string"
      }
     }
    }
   },
   "required": [
    "contact"
   ]
  },
  "pickup": {
   "type": "object",
   "properties": {
    "function": {
     "enum": [
      "Create"
     ]
    },
    "isTest": {
     "type": "boolean"
    },
    "requestedPickupDate": {
     "type": "string",
     "pattern": "\\d{4}-\\d{2}-\\d{2}"
    },
    "specialInstructions": {
     "type": "string"
    }
   },
   "required": [
    "function",
    "requestedPickupDate"
   ]
  },
  "destinations": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "city": {
      "type": "string"
     },
     "country": {
      "enum": [
       "USA",
       "CAN",
       "MEX"
      ]
     },
     "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"
      ]
     },
     "count": {
      "type": "integer"
     },
     "weight": {
      "type": "integer"
     },
     "type": {
      "enum:": [
       "BAG",
       "BAR",
       "BIN",
       "BNDL",
       "BOX",
       "BSKT",
       "BULK",
       "CARBOY",
       "COIL",
       "CPT",
       "CRT",
       "CTN",
       "CYL",
       "DAC",
       "DRM",
       "GAY",
       "IBC",
       "JER",
       "LSE",
       "MLBG",
       "NSTD",
       "PAIL",
       "PIG",
       "PLT",
       "RACK",
       "REEL",
       "ROLL",
       "SKD",
       "STK",
       "TL",
       "TANK",
       "TOTE",
       "UNIT",
       "BDL",
       "BSK",
       "CBY",
       "COL",
       "GLD",
       "PAL",
       "RCK",
       "REL",
       "ROL",
       "TNK",
       "TBN",
       "UNT"
      ]
     }
    },
    "required": [
     "city",
     "country",
     "postalCode",
     "stateProvince",
     "count",
     "type",
     "weight"
    ]
   }
  },
  "notifications": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "email": {
      "type": "string"
     }
    },
    "required": [
     "email"
    ]
   }
  },
  "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"
      }
     }
    },
    "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": [
         "ShipperReferenceNumber",
         "ExpeditedQuoteNumber"
        ]
       },
       "value": {
        "type": "string"
       }
      },
      "required": [
       "name",
       "value"
      ]
     }
    }
   },
   "required": []
  }
 },
 "required": [
  "pickup",
  "destinations",
  "origin"
 ]
}