{
 "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})?)?"
        }
       }
      }
     }
    },
    "codes": {
     "type": "array",
     "items": {
      "enum": [
       "IDL",
       "IPU",
       "PPD",
       "LFTD",
       "LFTP",
       "LTDAD",
       "LTDAP",
       "OVR",
       "PSN",
       "PSC",
       "BROKER_SELECT_OPTION",
       "CALL_BEFORE_DELIVERY",
       "CUSTOM_DELIVERY_WINDOW",
       "DANGEROUS_GOODS",
       "DO_NOT_BREAK_DOWN_PALLETS",
       "DO_NOT_STACK_PALLETS",
       "EXTREME_LENGTH",
       "FOOD",
       "FREIGHT_DIRECT",
       "FREIGHT_GUARANTEE",
       "INSIDE_DELIVERY",
       "INSIDE_PICKUP",
       "LIFTGATE_DELIVERY",
       "LIFTGATE_PICKUP",
       "LIMITED_ACCESS_DELIVERY",
       "LIMITED_ACCESS_PICKUP",
       "OVER_LENGTH",
       "POISON",
       "PROTECTION_FROM_FREEZING",
       "TOP_LOAD",
       "FEDEX_FREIGHT_PRIORITY",
       "FEDEX_FREIGHT_ECONOMY",
       "FEDEX_FIRST_FREIGHT",
       "FEDEX_1_DAY_FREIGHT",
       "FEDEX_2_DAY_FREIGHT",
       "FEDEX_3_DAY_FREIGHT",
       "INTERNATIONAL_PRIORITY_FREIGHT",
       "INTERNATIONAL_ECONOMY_FREIGHT",
       "FEDEX_INTERNATIONAL_DEFERRED_FREIGHT",
       "INTERNATIONAL_DISTRIBUTION_FREIGHT"
      ]
     }
    }
   },
   "required": [
    "codes"
   ]
  },
  "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": [
        "integer",
        "string"
       ]
      },
      "phoneExt": {
       "type": [
        "integer",
        "string"
       ]
      }
     },
     "required": [
      "phone"
     ]
    },
    "country": {
     "enum": [
      "USA",
      "CAN",
      "MEX"
     ]
    },
    "name": {
     "type": "string"
    },
    "postalCode": {
     "type": [
      "string",
      "integer"
     ],
     "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"
     ]
    },
    "addressClassification": {
     "enum": [
      "MIXED",
      "UNKNOWN",
      "BUSINESS",
      "RESIDENTIAL"
     ]
    }
   },
   "required": [
    "account"
   ]
  },
  "pickup": {
   "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"
     ]
    },
    "account": {
     "type": "string",
     "description": "Fedex Account Number"
    },
    "freightAccount": {
     "type": "string",
     "description": "Fedex Account Number for freightPickupDetail.account"
    },
    "payment": {
     "enum": [
      "SENDER",
      "COLLECT"
     ]
    }
   },
   "required": [
    "function",
    "requestedPickupDate",
    "requestorRole",
    "account",
    "payment"
   ]
  },
  "commodities": {
   "type": "object",
   "properties": {
    "handlingUnits": {
     "type": "array",
     "items": {
      "type": "object",
      "properties": {
       "count": {
        "type": "integer"
       },
       "dimensionsUnit": {
        "enum": [
         "Inches",
         "Centimeters"
        ]
       },
       "pro": {
        "type": "string",
        "description": "tracking number of this portion of the shipment"
       },
       "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"
          },
          "destination": {
           "type": "object",
           "properties": {
            "postalCode": {
             "type": [
              "string",
              "integer"
             ],
             "pattern": "(?:\\d{5}(?:[-]?\\d{4})?)|(?:(?:[A-Za-z][0-9][A-Za-z][0-9][A-Za-z])[0-9]?)"
            },
            "countryCode": {
             "enum": [
              "USA",
              "CAN",
              "MEX"
             ]
            }
           }
          },
          "hazardous": {
           "type": "boolean"
          },
          "hazardousDescription": {
           "type": "string"
          },
          "hazardousDetails": {
           "type": "object",
           "properties": {
            "class": {
             "type": "string"
            },
            "contractNumber": {
             "type": "string"
            },
            "packingGroup": {
             "type": "string"
            },
            "propername": {
             "type": "string"
            },
            "technicalName": {
             "type": "string"
            },
            "unnaNumber": {
             "type": "string"
            },
            "weight": {
             "type": [
              "number",
              "string"
             ]
            },
            "weightUnit": {
             "enum": [
              "Pounds",
              "Kilograms",
              "Lbs",
              "KG"
             ]
            }
           },
           "required": [
            "class",
            "contractNumber",
            "packingGroup",
            "propername",
            "technicalName",
            "unnaNumber",
            "weight",
            "weightUnit"
           ]
          },
          "nmfc": {
           "type": "string",
           "pattern": "\\d+"
          },
          "nmfcSub": {
           "type": "string",
           "pattern": "\\d+"
          },
          "packagingType": {
           "enum:": [
            "PARCEL",
            "SACK",
            "SHRINK_WRAPPED",
            "BAG",
            "BBL",
            "BSK",
            "BOX",
            "BXT",
            "BDL",
            "CAB",
            "CTN",
            "CAS",
            "CHS",
            "CNT",
            "CRT",
            "CYL",
            "DRM",
            "ENV",
            "HPR",
            "OTH",
            "PKG",
            "PAL",
            "PAT",
            "PCS",
            "REL",
            "ROL",
            "SKD",
            "TNK",
            "TBN",
            "TBE",
            "UNT",
            "BARREL",
            "BASKET",
            "BUCKET",
            "BUNDLE",
            "CAGE",
            "CARTON",
            "CASE",
            "CHEST",
            "CONTAINER",
            "CRATE",
            "CYLINDER",
            "DRUM",
            "ENVELOPE",
            "HAMPER",
            "OTHER",
            "PACKAGE",
            "PAIL",
            "PALLET",
            "PIECE",
            "REEL",
            "ROLL",
            "SKID",
            "TANK",
            "TOTE_BIN",
            "TUBE",
            "UNIT"
           ]
          },
          "pieces": {
           "type": "integer"
          },
          "weight": {
           "type": [
            "number",
            "string"
           ]
          },
          "weightUnit": {
           "enum": [
            "Pounds",
            "Kilograms",
            "Lbs",
            "KG"
           ]
          },
          "codes": {
           "type": "array",
           "items": {
            "enum": [
             "IDL",
             "IPU",
             "PPD",
             "LFTD",
             "LFTP",
             "LTDAD",
             "LTDAP",
             "OVR",
             "PSN",
             "PSC",
             "BROKER_SELECT_OPTION",
             "CALL_BEFORE_DELIVERY",
             "CUSTOM_DELIVERY_WINDOW",
             "DANGEROUS_GOODS",
             "DO_NOT_BREAK_DOWN_PALLETS",
             "DO_NOT_STACK_PALLETS",
             "EXTREME_LENGTH",
             "FOOD",
             "FREIGHT_DIRECT",
             "FREIGHT_GUARANTEE",
             "INSIDE_DELIVERY",
             "INSIDE_PICKUP",
             "LIFTGATE_DELIVERY",
             "LIFTGATE_PICKUP",
             "LIMITED_ACCESS_DELIVERY",
             "LIMITED_ACCESS_PICKUP",
             "OVER_LENGTH",
             "POISON",
             "PROTECTION_FROM_FREEZING",
             "TOP_LOAD"
            ]
           }
          },
          "trackingQualifier": {
           "type": "string"
          },
          "trackingUniqueId": {
           "type": "string"
          },
          "service": {
           "enum": [
            "FEDEX_FREIGHT_ECONOMY",
            "FEDEX_FREIGHT_PRIORITY"
           ]
          }
         },
         "required": [
          "packagingType",
          "weight",
          "weightUnit"
         ]
        }
       },
       "width": {
        "type": "integer"
       }
      },
      "required": [
       "lineItems"
      ]
     }
    },
    "description": {
     "type": "string"
    }
   }
  },
  "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": [
        "integer",
        "string"
       ]
      },
      "phoneExt": {
       "type": [
        "integer",
        "string"
       ]
      }
     },
     "required": [
      "phone"
     ]
    },
    "country": {
     "enum": [
      "USA",
      "CAN",
      "MEX"
     ]
    },
    "name": {
     "type": "string"
    },
    "postalCode": {
     "type": [
      "string",
      "integer"
     ],
     "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"
     ]
    },
    "addressClassification": {
     "enum": [
      "MIXED",
      "UNKNOWN",
      "BUSINESS",
      "RESIDENTIAL"
     ]
    }
   },
   "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": [
        "integer",
        "string"
       ]
      },
      "phoneExt": {
       "type": [
        "integer",
        "string"
       ]
      }
     },
     "required": [
      "phone"
     ]
    },
    "country": {
     "enum": [
      "USA",
      "CAN",
      "MEX"
     ]
    },
    "name": {
     "type": "string"
    },
    "postalCode": {
     "type": [
      "string",
      "integer"
     ],
     "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"
     ]
    },
    "addressClassification": {
     "enum": [
      "MIXED",
      "UNKNOWN",
      "BUSINESS",
      "RESIDENTIAL"
     ]
    }
   },
   "required": [
    "country",
    "postalCode"
   ]
  },
  "notifications": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "email": {
      "type": "string"
     },
     "locale": {
      "type": "string",
      "pattern": "^[a-z]{2}(?:_[A_Z]{2})?"
     }
    },
    "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": [
        "integer",
        "string"
       ]
      },
      "phoneExt": {
       "type": [
        "integer",
        "string"
       ]
      }
     },
     "required": [
      "phone"
     ]
    },
    "country": {
     "enum": [
      "USA",
      "CAN",
      "MEX"
     ]
    },
    "name": {
     "type": "string"
    },
    "postalCode": {
     "type": [
      "string",
      "integer"
     ],
     "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"
     ]
    },
    "addressClassification": {
     "enum": [
      "MIXED",
      "UNKNOWN",
      "BUSINESS",
      "RESIDENTIAL"
     ]
    }
   },
   "required": [
    "address1",
    "city",
    "contact",
    "country",
    "postalCode",
    "stateProvince"
   ]
  },
  "referenceNumbers": {
   "type": "object",
   "properties": {
    "pro": {
     "type": "string"
    }
   },
   "required": []
  },
  "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": [
      "number",
      "string"
     ]
    },
    "handlingUnits": {
     "type": "integer"
    },
    "linearLength": {
     "type": "integer"
    },
    "netWeight": {
     "type": [
      "number",
      "string"
     ]
    },
    "weightUnit": {
     "enum": [
      "Pounds",
      "Kilograms",
      "Lbs",
      "KG"
     ]
    }
   },
   "required": [
    "grossWeight",
    "weightUnit"
   ]
  },
  "version": {
   "enum": [
    "2.1.0"
   ]
  }
 },
 "required": [
  "pickup",
  "destination",
  "origin",
  "version"
 ]
}