{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/purolator/main/json-schema/purolator-create-shipment-request-schema.json",
  "title": "CreateShipmentRequest",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/purolator-create-void-shipment-openapi.yml#/components/schemas/CreateShipmentRequest",
  "type": "object",
  "required": [
    "lineOfBusiness",
    "outboundShipment",
    "shipmentDocuments"
  ],
  "properties": {
    "lineOfBusiness": {
      "$ref": "#/$defs/LineOfBusiness"
    },
    "shipmentDate": {
      "$ref": "#/$defs/ShipmentDate"
    },
    "returnsManagement": {
      "type": "boolean",
      "description": "When true, outbound is treated as an RMS (returns management) shipment and returnShipment is ignored."
    },
    "rma": {
      "type": "string",
      "description": "Return merchandise authorization number."
    },
    "validateOnly": {
      "type": "boolean",
      "description": "When true, validates the request without creating a shipment or generating PINs."
    },
    "returnRates": {
      "type": "boolean",
      "description": "When true, include rate estimates in the response. 930-division accounts (Account Lookup SALES_DISTRICT 930) also receive estimates when this flag is false. The flag is stored as sent."
    },
    "shipmentDocuments": {
      "$ref": "#/$defs/ShipmentDocuments"
    },
    "outboundShipment": {
      "$ref": "#/$defs/OutboundShipment"
    },
    "returnShipment": {
      "$ref": "#/$defs/ReturnShipment"
    }
  },
  "$defs": {
    "BuyerInformation": {
      "type": "object",
      "properties": {
        "companyName": {
          "type": "string",
          "maxLength": 40,
          "description": "Company name."
        },
        "attentionTo": {
          "type": "string",
          "maxLength": 40,
          "description": "Attention to / contact name."
        },
        "streetAddress": {
          "type": "array",
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "type": "string",
            "maxLength": 40
          },
          "description": "Maximum 3 address lines. Each line has a max length of 40 characters."
        },
        "city": {
          "type": "string",
          "maxLength": 40,
          "description": "City."
        },
        "provinceStateCode": {
          "type": "string",
          "maxLength": 40,
          "description": "2-character province/state code. Required for Canadian and US addresses. Canadian provinces: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT. US states: AL, AK, AZ, AR, CA, CO, CT, 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, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY."
        },
        "country": {
          "type": "string",
          "maxLength": 2,
          "enum": [
            "AD",
            "AE",
            "AF",
            "AG",
            "AI",
            "AL",
            "AM",
            "AN",
            "AO",
            "AQ",
            "AR",
            "AS",
            "AT",
            "AU",
            "AW",
            "AX",
            "AZ",
            "BA",
            "BB",
            "BD",
            "BE",
            "BF",
            "BG",
            "BH",
            "BI",
            "BJ",
            "BL",
            "BM",
            "BN",
            "BO",
            "BR",
            "BS",
            "BT",
            "BV",
            "BW",
            "BY",
            "BZ",
            "CA",
            "CC",
            "CD",
            "CF",
            "CG",
            "CH",
            "CI",
            "CK",
            "CL",
            "CM",
            "CN",
            "CO",
            "CR",
            "CU",
            "CV",
            "CX",
            "CY",
            "CZ",
            "DE",
            "DJ",
            "DK",
            "DM",
            "DO",
            "DZ",
            "EC",
            "EE",
            "EG",
            "EH",
            "ER",
            "ES",
            "ET",
            "EU",
            "FI",
            "FJ",
            "FK",
            "FM",
            "FO",
            "FR",
            "GA",
            "GB",
            "GD",
            "GE",
            "GF",
            "GG",
            "GH",
            "GI",
            "GL",
            "GM",
            "GN",
            "GP",
            "GQ",
            "GR",
            "GS",
            "GT",
            "GU",
            "GW",
            "GY",
            "HK",
            "HM",
            "HN",
            "HR",
            "HT",
            "HU",
            "IC",
            "ID",
            "IE",
            "IL",
            "IM",
            "IN",
            "IO",
            "IQ",
            "IR",
            "IS",
            "IT",
            "JE",
            "JM",
            "JO",
            "JP",
            "KE",
            "KG",
            "KH",
            "KI",
            "KM",
            "KN",
            "KP",
            "KR",
            "KW",
            "KY",
            "KZ",
            "LA",
            "LB",
            "LC",
            "LI",
            "LK",
            "LR",
            "LS",
            "LT",
            "LU",
            "LV",
            "LY",
            "MA",
            "MC",
            "MD",
            "ME",
            "MG",
            "MH",
            "MK",
            "ML",
            "MM",
            "MN",
            "MO",
            "MP",
            "MQ",
            "MR",
            "MS",
            "MT",
            "MU",
            "MV",
            "MW",
            "MX",
            "MY",
            "MZ",
            "NA",
            "NC",
            "NE",
            "NF",
            "NG",
            "NI",
            "NL",
            "NO",
            "NP",
            "NR",
            "NT",
            "NU",
            "NZ",
            "OM",
            "OR",
            "PA",
            "PE",
            "PF",
            "PG",
            "PH",
            "PK",
            "PL",
            "PM",
            "PN",
            "PR",
            "PS",
            "PT",
            "PW",
            "PY",
            "QA",
            "RE",
            "RO",
            "RS",
            "RU",
            "RW",
            "SA",
            "SB",
            "SC",
            "SD",
            "SE",
            "SG",
            "SH",
            "SI",
            "SJ",
            "SK",
            "SL",
            "SM",
            "SN",
            "SO",
            "SR",
            "ST",
            "SV",
            "SY",
            "SZ",
            "TC",
            "TD",
            "TF",
            "TG",
            "TH",
            "TJ",
            "TK",
            "TL",
            "TM",
            "TN",
            "TO",
            "TP",
            "TR",
            "TT",
            "TV",
            "TW",
            "TZ",
            "UA",
            "UG",
            "UM",
            "UN",
            "US",
            "UY",
            "UZ",
            "VA",
            "VC",
            "VE",
            "VG",
            "VI",
            "VN",
            "VU",
            "WF",
            "WS",
            "XB",
            "XC",
            "XE",
            "XM",
            "XN",
            "XS",
            "XY",
            "YE",
            "YT",
            "ZA",
            "ZM",
            "ZW",
            "ZZ"
          ],
          "description": "2-character country code."
        },
        "postalZipCode": {
          "type": "string",
          "maxLength": 10,
          "description": "Canadian postal code, US ZIP code, or international postal code."
        },
        "phoneNumber": {
          "type": "string",
          "maxLength": 15,
          "description": "Phone number, 10-15 digits. Conditionally required."
        }
      },
      "required": [
        "city",
        "provinceStateCode",
        "country",
        "postalZipCode"
      ]
    },
    "ContentDetails": {
      "type": "object",
      "properties": {
        "description": {
          "type": "string",
          "maxLength": 50
        },
        "harmonizedCode": {
          "type": "string"
        },
        "countryOfManufacture": {
          "type": "string",
          "maxLength": 2,
          "description": "ISO 2-character country code."
        },
        "unitValue": {
          "type": "number",
          "format": "double",
          "maximum": 99999.99
        },
        "productCode": {
          "type": "string"
        },
        "quantity": {
          "type": "integer"
        },
        "unitOfMeasure": {
          "type": "string"
        },
        "usmcaDocumentIndicator": {
          "type": "boolean"
        },
        "fdaDocumentIndicator": {
          "type": "boolean"
        },
        "senderIsProducerIndicator": {
          "type": "boolean"
        },
        "textileIndicator": {
          "type": "boolean"
        },
        "textileManufacturer": {
          "type": "string"
        },
        "manufacturersFDARegistrationNumber": {
          "type": "string"
        },
        "shippersFDARegistrationNumber": {
          "type": "string"
        },
        "priorNoticeConfirmationNumber": {
          "type": "string"
        },
        "netWeight": {
          "type": "number",
          "format": "double"
        }
      }
    },
    "CrossBorderInformation": {
      "type": "object",
      "properties": {
        "documentsOnlyIndicator": {
          "type": "boolean",
          "description": "When true, omitted, or null, non-document and content details are not required and taxesPaid defaults to DDU. Must not be present on domestic (CA to CA) shipments."
        },
        "currency": {
          "type": "string",
          "enum": [
            "CAD",
            "USD"
          ],
          "description": "Optional. Only CAD or USD are permitted for ICP Northbound shipments."
        },
        "nonDocumentsInformation": {
          "$ref": "#/$defs/NonDocumentsInformation"
        },
        "contentDetails": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContentDetails"
          },
          "description": "Required (non-empty) for non-domestic, non-documents-only shipments."
        }
      }
    },
    "CustomerReferenceInformation": {
      "type": "object",
      "properties": {
        "costCenter": {
          "type": "string",
          "maxLength": 30
        },
        "notes": {
          "type": "string",
          "maxLength": 70
        },
        "shipmentReference1": {
          "type": "string",
          "maxLength": 40
        },
        "shipmentReference2": {
          "type": "string",
          "maxLength": 40
        },
        "shipmentReference3": {
          "type": "string",
          "maxLength": 40
        },
        "shipmentReference4": {
          "type": "string",
          "maxLength": 40
        },
        "shipmentReference5": {
          "type": "string",
          "maxLength": 40
        },
        "costCenterReference": {
          "type": "string",
          "maxLength": 20,
          "description": "Optional. Alphanumeric only (A-Z, a-z, 0-9). No hyphens, spaces, or special characters. Max 20 characters."
        }
      }
    },
    "ExpressChequeInformation": {
      "type": "object",
      "properties": {
        "companyName": {
          "type": "string",
          "maxLength": 40,
          "description": "Company name."
        },
        "attentionTo": {
          "type": "string",
          "maxLength": 40,
          "description": "Attention to / contact name."
        },
        "streetAddress": {
          "type": "array",
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "type": "string",
            "maxLength": 40
          },
          "description": "Maximum 3 address lines. Each line has a max length of 40 characters."
        },
        "city": {
          "type": "string",
          "maxLength": 40,
          "description": "City."
        },
        "provinceStateCode": {
          "type": "string",
          "maxLength": 40,
          "description": "2-character province/state code. Required for Canadian and US addresses. Canadian provinces: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT. US states: AL, AK, AZ, AR, CA, CO, CT, 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, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY."
        },
        "country": {
          "type": "string",
          "maxLength": 2,
          "enum": [
            "AD",
            "AE",
            "AF",
            "AG",
            "AI",
            "AL",
            "AM",
            "AN",
            "AO",
            "AQ",
            "AR",
            "AS",
            "AT",
            "AU",
            "AW",
            "AX",
            "AZ",
            "BA",
            "BB",
            "BD",
            "BE",
            "BF",
            "BG",
            "BH",
            "BI",
            "BJ",
            "BL",
            "BM",
            "BN",
            "BO",
            "BR",
            "BS",
            "BT",
            "BV",
            "BW",
            "BY",
            "BZ",
            "CA",
            "CC",
            "CD",
            "CF",
            "CG",
            "CH",
            "CI",
            "CK",
            "CL",
            "CM",
            "CN",
            "CO",
            "CR",
            "CU",
            "CV",
            "CX",
            "CY",
            "CZ",
            "DE",
            "DJ",
            "DK",
            "DM",
            "DO",
            "DZ",
            "EC",
            "EE",
            "EG",
            "EH",
            "ER",
            "ES",
            "ET",
            "EU",
            "FI",
            "FJ",
            "FK",
            "FM",
            "FO",
            "FR",
            "GA",
            "GB",
            "GD",
            "GE",
            "GF",
            "GG",
            "GH",
            "GI",
            "GL",
            "GM",
            "GN",
            "GP",
            "GQ",
            "GR",
            "GS",
            "GT",
            "GU",
            "GW",
            "GY",
            "HK",
            "HM",
            "HN",
            "HR",
            "HT",
            "HU",
            "IC",
            "ID",
            "IE",
            "IL",
            "IM",
            "IN",
            "IO",
            "IQ",
            "IR",
            "IS",
            "IT",
            "JE",
            "JM",
            "JO",
            "JP",
            "KE",
            "KG",
            "KH",
            "KI",
            "KM",
            "KN",
            "KP",
            "KR",
            "KW",
            "KY",
            "KZ",
            "LA",
            "LB",
            "LC",
            "LI",
            "LK",
            "LR",
            "LS",
            "LT",
            "LU",
            "LV",
            "LY",
            "MA",
            "MC",
            "MD",
            "ME",
            "MG",
            "MH",
            "MK",
            "ML",
            "MM",
            "MN",
            "MO",
            "MP",
            "MQ",
            "MR",
            "MS",
            "MT",
            "MU",
            "MV",
            "MW",
            "MX",
            "MY",
            "MZ",
            "NA",
            "NC",
            "NE",
            "NF",
            "NG",
            "NI",
            "NL",
            "NO",
            "NP",
            "NR",
            "NT",
            "NU",
            "NZ",
            "OM",
            "OR",
            "PA",
            "PE",
            "PF",
            "PG",
            "PH",
            "PK",
            "PL",
            "PM",
            "PN",
            "PR",
            "PS",
            "PT",
            "PW",
            "PY",
            "QA",
            "RE",
            "RO",
            "RS",
            "RU",
            "RW",
            "SA",
            "SB",
            "SC",
            "SD",
            "SE",
            "SG",
            "SH",
            "SI",
            "SJ",
            "SK",
            "SL",
            "SM",
            "SN",
            "SO",
            "SR",
            "ST",
            "SV",
            "SY",
            "SZ",
            "TC",
            "TD",
            "TF",
            "TG",
            "TH",
            "TJ",
            "TK",
            "TL",
            "TM",
            "TN",
            "TO",
            "TP",
            "TR",
            "TT",
            "TV",
            "TW",
            "TZ",
            "UA",
            "UG",
            "UM",
            "UN",
            "US",
            "UY",
            "UZ",
            "VA",
            "VC",
            "VE",
            "VG",
            "VI",
            "VN",
            "VU",
            "WF",
            "WS",
            "XB",
            "XC",
            "XE",
            "XM",
            "XN",
            "XS",
            "XY",
            "YE",
            "YT",
            "ZA",
            "ZM",
            "ZW",
            "ZZ"
          ],
          "description": "2-character country code."
        },
        "postalZipCode": {
          "type": "string",
          "maxLength": 10,
          "description": "Canadian postal code, US ZIP code, or international postal code."
        },
        "phoneNumber": {
          "type": "string",
          "maxLength": 15,
          "description": "Phone number, 10-15 digits. Conditionally required."
        }
      },
      "required": [
        "city",
        "provinceStateCode",
        "country",
        "postalZipCode"
      ]
    },
    "FromOnLabelInformation": {
      "allOf": [
        {
          "type": "object",
          "properties": {
            "fromOnLabelIndicator": {
              "type": "boolean",
              "description": "When true, from-on-label address fields are required."
            }
          }
        },
        {
          "type": "object",
          "properties": {
            "companyName": {
              "type": "string",
              "maxLength": 40,
              "description": "Company name."
            },
            "attentionTo": {
              "type": "string",
              "maxLength": 40,
              "description": "Attention to / contact name."
            },
            "streetAddress": {
              "type": "array",
              "minItems": 1,
              "maxItems": 3,
              "items": {
                "type": "string",
                "maxLength": 40
              },
              "description": "Maximum 3 address lines. Each line has a max length of 40 characters."
            },
            "city": {
              "type": "string",
              "maxLength": 40,
              "description": "City."
            },
            "provinceStateCode": {
              "type": "string",
              "maxLength": 40,
              "description": "2-character province/state code. Required for Canadian and US addresses. Canadian provinces: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT. US states: AL, AK, AZ, AR, CA, CO, CT, 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, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY."
            },
            "country": {
              "type": "string",
              "maxLength": 2,
              "enum": [
                "AD",
                "AE",
                "AF",
                "AG",
                "AI",
                "AL",
                "AM",
                "AN",
                "AO",
                "AQ",
                "AR",
                "AS",
                "AT",
                "AU",
                "AW",
                "AX",
                "AZ",
                "BA",
                "BB",
                "BD",
                "BE",
                "BF",
                "BG",
                "BH",
                "BI",
                "BJ",
                "BL",
                "BM",
                "BN",
                "BO",
                "BR",
                "BS",
                "BT",
                "BV",
                "BW",
                "BY",
                "BZ",
                "CA",
                "CC",
                "CD",
                "CF",
                "CG",
                "CH",
                "CI",
                "CK",
                "CL",
                "CM",
                "CN",
                "CO",
                "CR",
                "CU",
                "CV",
                "CX",
                "CY",
                "CZ",
                "DE",
                "DJ",
                "DK",
                "DM",
                "DO",
                "DZ",
                "EC",
                "EE",
                "EG",
                "EH",
                "ER",
                "ES",
                "ET",
                "EU",
                "FI",
                "FJ",
                "FK",
                "FM",
                "FO",
                "FR",
                "GA",
                "GB",
                "GD",
                "GE",
                "GF",
                "GG",
                "GH",
                "GI",
                "GL",
                "GM",
                "GN",
                "GP",
                "GQ",
                "GR",
                "GS",
                "GT",
                "GU",
                "GW",
                "GY",
                "HK",
                "HM",
                "HN",
                "HR",
                "HT",
                "HU",
                "IC",
                "ID",
                "IE",
                "IL",
                "IM",
                "IN",
                "IO",
                "IQ",
                "IR",
                "IS",
                "IT",
                "JE",
                "JM",
                "JO",
                "JP",
                "KE",
                "KG",
                "KH",
                "KI",
                "KM",
                "KN",
                "KP",
                "KR",
                "KW",
                "KY",
                "KZ",
                "LA",
                "LB",
                "LC",
                "LI",
                "LK",
                "LR",
                "LS",
                "LT",
                "LU",
                "LV",
                "LY",
                "MA",
                "MC",
                "MD",
                "ME",
                "MG",
                "MH",
                "MK",
                "ML",
                "MM",
                "MN",
                "MO",
                "MP",
                "MQ",
                "MR",
                "MS",
                "MT",
                "MU",
                "MV",
                "MW",
                "MX",
                "MY",
                "MZ",
                "NA",
                "NC",
                "NE",
                "NF",
                "NG",
                "NI",
                "NL",
                "NO",
                "NP",
                "NR",
                "NT",
                "NU",
                "NZ",
                "OM",
                "OR",
                "PA",
                "PE",
                "PF",
                "PG",
                "PH",
                "PK",
                "PL",
                "PM",
                "PN",
                "PR",
                "PS",
                "PT",
                "PW",
                "PY",
                "QA",
                "RE",
                "RO",
                "RS",
                "RU",
                "RW",
                "SA",
                "SB",
                "SC",
                "SD",
                "SE",
                "SG",
                "SH",
                "SI",
                "SJ",
                "SK",
                "SL",
                "SM",
                "SN",
                "SO",
                "SR",
                "ST",
                "SV",
                "SY",
                "SZ",
                "TC",
                "TD",
                "TF",
                "TG",
                "TH",
                "TJ",
                "TK",
                "TL",
                "TM",
                "TN",
                "TO",
                "TP",
                "TR",
                "TT",
                "TV",
                "TW",
                "TZ",
                "UA",
                "UG",
                "UM",
                "UN",
                "US",
                "UY",
                "UZ",
                "VA",
                "VC",
                "VE",
                "VG",
                "VI",
                "VN",
                "VU",
                "WF",
                "WS",
                "XB",
                "XC",
                "XE",
                "XM",
                "XN",
                "XS",
                "XY",
                "YE",
                "YT",
                "ZA",
                "ZM",
                "ZW",
                "ZZ"
              ],
              "description": "2-character country code."
            },
            "postalZipCode": {
              "type": "string",
              "maxLength": 10,
              "description": "Canadian postal code, US ZIP code, or international postal code."
            },
            "phoneNumber": {
              "type": "string",
              "maxLength": 15,
              "description": "Phone number, 10-15 digits. Conditionally required."
            }
          },
          "required": [
            "city",
            "provinceStateCode",
            "country",
            "postalZipCode"
          ]
        }
      ]
    },
    "Label": {
      "type": "object",
      "required": [
        "outputType"
      ],
      "properties": {
        "outputType": {
          "type": "string",
          "enum": [
            "PDF",
            "ZPL",
            "DPL",
            "PNG",
            "CODE128"
          ],
          "description": "Document output type. Case-insensitive."
        },
        "printerFormat": {
          "type": "string",
          "enum": [
            "Thermal",
            "Regular",
            "Laser"
          ],
          "description": "Printer format. Optional for PNG/PDF/ZPL/DPL. Forced to NA for CODE128."
        },
        "responseType": {
          "type": "string",
          "enum": [
            "BASE64",
            "URL",
            "String"
          ],
          "description": "How document content is returned. Mandatory for some output types."
        }
      }
    },
    "LineOfBusiness": {
      "type": "string",
      "enum": [
        "Courier",
        "Freight"
      ],
      "description": "Line of business. Case-insensitive. Only Courier is supported."
    },
    "NonDocumentsInformation": {
      "type": "object",
      "properties": {
        "taxesPaid": {
          "type": "string",
          "enum": [
            "DDU",
            "DDP"
          ],
          "description": "Required for non-domestic, non-documents-only shipments."
        },
        "currencyForDutiableGoods": {
          "type": "string",
          "enum": [
            "CAD",
            "USD",
            "EUR"
          ]
        },
        "importExportType": {
          "type": "string",
          "enum": [
            "Permanent",
            "Temporary",
            "Repair",
            "Return"
          ]
        },
        "extraCharges": {
          "type": "integer"
        },
        "extraChargeCode": {
          "type": "string"
        },
        "specialInstructionFlag": {
          "type": "string",
          "enum": [
            "Y",
            "N"
          ]
        },
        "billDutiesToParty": {
          "type": "string",
          "enum": [
            "Sender",
            "Receiver",
            "Buyer"
          ],
          "description": "Who pays duties/taxes. Case-insensitive."
        },
        "businessRelationship": {
          "type": "string",
          "enum": [
            "TRUE",
            "FALSE"
          ],
          "description": "Required for non-domestic, non-documents-only shipments."
        },
        "customsInvoiceDocumentIndicator": {
          "type": "boolean"
        },
        "brokerageReferenceNumber": {
          "type": "string",
          "maxLength": 26,
          "description": "Optional ICP shipment-level brokerage billing reference. Alphanumeric, no control characters. Ignored when brokerage provider is No Broker/Other."
        }
      }
    },
    "NotificationType": {
      "type": "object",
      "required": [
        "notificationId"
      ],
      "properties": {
        "notificationId": {
          "type": "string",
          "enum": [
            "NotifyWhenExceptionOccurs",
            "NotifyWhenDeliveryOccurs",
            "ShipmentConfirmation-Requester",
            "ShipmentNotification-Receiver"
          ]
        },
        "notificationMessage": {
          "type": "string",
          "maxLength": 70,
          "description": "Mandatory when notificationId is ShipmentNotification-Receiver."
        }
      }
    },
    "Notifications": {
      "type": "object",
      "properties": {
        "requestorName": {
          "type": "string",
          "maxLength": 70
        },
        "requestorEmail": {
          "type": "string",
          "format": "email",
          "maxLength": 70,
          "description": "Required when subscriptions are present."
        },
        "subscriptions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Subscription"
          }
        }
      }
    },
    "OutboundShipment": {
      "type": "object",
      "required": [
        "paymentInformation",
        "pickupType",
        "senderInformation",
        "receiverInformation",
        "shipmentInformation"
      ],
      "properties": {
        "paymentInformation": {
          "$ref": "#/$defs/PaymentInformation"
        },
        "pickupType": {
          "type": "string",
          "enum": [
            "PRESCHEDULED",
            "DROPOFF"
          ],
          "description": "Pickup type. Case-insensitive."
        },
        "senderInformation": {
          "$ref": "#/$defs/SenderInformation"
        },
        "receiverInformation": {
          "$ref": "#/$defs/ReceiverInformation"
        },
        "usOriginInformation": {
          "$ref": "#/$defs/USOriginInformation"
        },
        "fromOnLabelInformation": {
          "$ref": "#/$defs/FromOnLabelInformation"
        },
        "expressChequeInformation": {
          "$ref": "#/$defs/ExpressChequeInformation"
        },
        "buyerInformation": {
          "$ref": "#/$defs/BuyerInformation"
        },
        "brokerageVendorAddress": {
          "$ref": "#/$defs/BuyerInformation",
          "description": "Mandatory for ICP when brokerage provider is not No Broker/Other. US and CA only."
        },
        "brokerageExporterAddress": {
          "$ref": "#/$defs/BuyerInformation",
          "description": "Optional ICP exporter address. US and CA only."
        },
        "thirdPartyBillingInformation": {
          "$ref": "#/$defs/ThirdPartyBillingInformation"
        },
        "shipmentInformation": {
          "$ref": "#/$defs/ShipmentInformation"
        },
        "customerReferenceInformation": {
          "$ref": "#/$defs/CustomerReferenceInformation"
        },
        "notifications": {
          "$ref": "#/$defs/Notifications"
        },
        "crossBorderInformation": {
          "$ref": "#/$defs/CrossBorderInformation"
        }
      }
    },
    "PackageInformation": {
      "type": "object",
      "required": [
        "packageWeight"
      ],
      "properties": {
        "packageWeight": {
          "type": "number",
          "format": "double",
          "multipleOf": 0.01,
          "exclusiveMinimum": true,
          "description": "Weight of the piece in the selected unit of measure (kg or lb). Must be greater than 0."
        },
        "packageLength": {
          "type": "number",
          "format": "double",
          "description": "Length of the piece (in or cm). If any dimension is supplied, length, width, and height are all required. Not required for Express Pack/Box/Envelope services."
        },
        "packageWidth": {
          "type": "number",
          "format": "double",
          "description": "Width of the piece (in or cm)."
        },
        "packageHeight": {
          "type": "number",
          "format": "double",
          "description": "Height of the piece (in or cm)."
        },
        "packageReference1": {
          "type": "string",
          "maxLength": 40
        },
        "packageReference2": {
          "type": "string",
          "maxLength": 40
        },
        "packageReference3": {
          "type": "string",
          "maxLength": 40
        },
        "packageReference4": {
          "type": "string",
          "maxLength": 40
        },
        "packageReference5": {
          "type": "string",
          "maxLength": 40
        },
        "packageOptionsInformation": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/PackageOptionIdValuePair"
          }
        },
        "brokeragePackageNumber": {
          "type": "string",
          "maxLength": 20,
          "description": "Optional ICP brokerage package number. Generated when omitted for ICP shipments whose brokerage provider is not No Broker/Other."
        }
      }
    },
    "PackageOptionIdValuePair": {
      "type": "object",
      "properties": {
        "optionId": {
          "type": "string",
          "enum": [
            "SpecialHandling",
            "SpecialHandlingType"
          ],
          "description": "Piece option identifier. Case-insensitive."
        },
        "optionIdValue": {
          "type": "string",
          "enum": [
            "true",
            "false",
            "ResidentialAreaHeavyweight",
            "FlatPackage",
            "AdditionalHandling",
            "LargePackage",
            "Oversized"
          ],
          "description": "Value for the piece option. Conditionally required."
        }
      }
    },
    "PaymentInformation": {
      "type": "object",
      "required": [
        "registeredAccountNumber",
        "paymentType"
      ],
      "properties": {
        "registeredAccountNumber": {
          "type": "string",
          "maxLength": 10,
          "description": "Registered (shipper) account number. Numeric, max 10 digits."
        },
        "billingAccountNumber": {
          "type": "string",
          "maxLength": 10,
          "description": "Billing account number. Mandatory when paymentType is RECEIVER or THIRDPARTY. When paymentType is SENDER, if provided it must match registeredAccountNumber."
        },
        "paymentType": {
          "type": "string",
          "enum": [
            "SENDER",
            "RECEIVER",
            "THIRDPARTY"
          ],
          "description": "Who pays for the shipment. Case-insensitive."
        }
      }
    },
    "ReceiverInformation": {
      "type": "object",
      "description": "Outbound receiver address. CA, US, or international. For crossBorderInformation the receiver must not be Canada (typically US).",
      "properties": {
        "companyName": {
          "type": "string",
          "maxLength": 40,
          "description": "Company name."
        },
        "attentionTo": {
          "type": "string",
          "maxLength": 40,
          "description": "Attention to / contact name."
        },
        "streetAddress": {
          "type": "array",
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "type": "string",
            "maxLength": 40
          },
          "description": "Maximum 3 address lines. Each line has a max length of 40 characters."
        },
        "city": {
          "type": "string",
          "maxLength": 40,
          "description": "City."
        },
        "provinceStateCode": {
          "type": "string",
          "maxLength": 40,
          "description": "2-character province/state code. Required for Canadian and US addresses. Canadian provinces: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT. US states: AL, AK, AZ, AR, CA, CO, CT, 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, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY."
        },
        "country": {
          "type": "string",
          "maxLength": 2,
          "enum": [
            "AD",
            "AE",
            "AF",
            "AG",
            "AI",
            "AL",
            "AM",
            "AN",
            "AO",
            "AQ",
            "AR",
            "AS",
            "AT",
            "AU",
            "AW",
            "AX",
            "AZ",
            "BA",
            "BB",
            "BD",
            "BE",
            "BF",
            "BG",
            "BH",
            "BI",
            "BJ",
            "BL",
            "BM",
            "BN",
            "BO",
            "BR",
            "BS",
            "BT",
            "BV",
            "BW",
            "BY",
            "BZ",
            "CA",
            "CC",
            "CD",
            "CF",
            "CG",
            "CH",
            "CI",
            "CK",
            "CL",
            "CM",
            "CN",
            "CO",
            "CR",
            "CU",
            "CV",
            "CX",
            "CY",
            "CZ",
            "DE",
            "DJ",
            "DK",
            "DM",
            "DO",
            "DZ",
            "EC",
            "EE",
            "EG",
            "EH",
            "ER",
            "ES",
            "ET",
            "EU",
            "FI",
            "FJ",
            "FK",
            "FM",
            "FO",
            "FR",
            "GA",
            "GB",
            "GD",
            "GE",
            "GF",
            "GG",
            "GH",
            "GI",
            "GL",
            "GM",
            "GN",
            "GP",
            "GQ",
            "GR",
            "GS",
            "GT",
            "GU",
            "GW",
            "GY",
            "HK",
            "HM",
            "HN",
            "HR",
            "HT",
            "HU",
            "IC",
            "ID",
            "IE",
            "IL",
            "IM",
            "IN",
            "IO",
            "IQ",
            "IR",
            "IS",
            "IT",
            "JE",
            "JM",
            "JO",
            "JP",
            "KE",
            "KG",
            "KH",
            "KI",
            "KM",
            "KN",
            "KP",
            "KR",
            "KW",
            "KY",
            "KZ",
            "LA",
            "LB",
            "LC",
            "LI",
            "LK",
            "LR",
            "LS",
            "LT",
            "LU",
            "LV",
            "LY",
            "MA",
            "MC",
            "MD",
            "ME",
            "MG",
            "MH",
            "MK",
            "ML",
            "MM",
            "MN",
            "MO",
            "MP",
            "MQ",
            "MR",
            "MS",
            "MT",
            "MU",
            "MV",
            "MW",
            "MX",
            "MY",
            "MZ",
            "NA",
            "NC",
            "NE",
            "NF",
            "NG",
            "NI",
            "NL",
            "NO",
            "NP",
            "NR",
            "NT",
            "NU",
            "NZ",
            "OM",
            "OR",
            "PA",
            "PE",
            "PF",
            "PG",
            "PH",
            "PK",
            "PL",
            "PM",
            "PN",
            "PR",
            "PS",
            "PT",
            "PW",
            "PY",
            "QA",
            "RE",
            "RO",
            "RS",
            "RU",
            "RW",
            "SA",
            "SB",
            "SC",
            "SD",
            "SE",
            "SG",
            "SH",
            "SI",
            "SJ",
            "SK",
            "SL",
            "SM",
            "SN",
            "SO",
            "SR",
            "ST",
            "SV",
            "SY",
            "SZ",
            "TC",
            "TD",
            "TF",
            "TG",
            "TH",
            "TJ",
            "TK",
            "TL",
            "TM",
            "TN",
            "TO",
            "TP",
            "TR",
            "TT",
            "TV",
            "TW",
            "TZ",
            "UA",
            "UG",
            "UM",
            "UN",
            "US",
            "UY",
            "UZ",
            "VA",
            "VC",
            "VE",
            "VG",
            "VI",
            "VN",
            "VU",
            "WF",
            "WS",
            "XB",
            "XC",
            "XE",
            "XM",
            "XN",
            "XS",
            "XY",
            "YE",
            "YT",
            "ZA",
            "ZM",
            "ZW",
            "ZZ"
          ],
          "description": "2-character country code. Province and postal code are required for CA/US."
        },
        "postalZipCode": {
          "type": "string",
          "maxLength": 10,
          "description": "Canadian postal code, US ZIP code, or international postal code."
        },
        "phoneNumber": {
          "type": "string",
          "maxLength": 15,
          "description": "Phone number, 10-15 digits. Conditionally required."
        }
      },
      "required": [
        "city",
        "country"
      ]
    },
    "ReturnReceiverInformation": {
      "type": "object",
      "description": "Return shipment receiver address. Always Canadian (CA).",
      "properties": {
        "companyName": {
          "type": "string",
          "maxLength": 40,
          "description": "Company name."
        },
        "attentionTo": {
          "type": "string",
          "maxLength": 40,
          "description": "Attention to / contact name."
        },
        "streetAddress": {
          "type": "array",
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "type": "string",
            "maxLength": 40
          },
          "description": "Maximum 3 address lines. Each line has a max length of 40 characters."
        },
        "city": {
          "type": "string",
          "maxLength": 40,
          "description": "City."
        },
        "provinceStateCode": {
          "type": "string",
          "maxLength": 40,
          "description": "2-character Canadian province code. Required. Canadian provinces: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT."
        },
        "country": {
          "type": "string",
          "maxLength": 2,
          "enum": [
            "CA"
          ],
          "description": "2-character country code. Return receiver must be CA."
        },
        "postalZipCode": {
          "type": "string",
          "maxLength": 10,
          "description": "Canadian postal code."
        },
        "phoneNumber": {
          "type": "string",
          "maxLength": 15,
          "description": "Phone number, 10-15 digits. Conditionally required."
        }
      },
      "required": [
        "city",
        "provinceStateCode",
        "country",
        "postalZipCode"
      ]
    },
    "ReturnShipment": {
      "type": "object",
      "required": [
        "numberOfReturnShipments",
        "pickupType",
        "paymentInformation",
        "senderInformation",
        "receiverInformation",
        "shipmentInformation"
      ],
      "properties": {
        "numberOfReturnShipments": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100,
          "description": "Number of return shipments to generate. Min 1, max 100."
        },
        "pickupType": {
          "type": "string",
          "enum": [
            "PRESCHEDULED",
            "DROPOFF"
          ]
        },
        "paymentInformation": {
          "$ref": "#/$defs/PaymentInformation"
        },
        "senderInformation": {
          "$ref": "#/$defs/SenderInformation"
        },
        "receiverInformation": {
          "$ref": "#/$defs/ReturnReceiverInformation"
        },
        "shipmentInformation": {
          "$ref": "#/$defs/ReturnShipmentInformation"
        },
        "customerReferenceInformation": {
          "$ref": "#/$defs/CustomerReferenceInformation"
        },
        "notifications": {
          "$ref": "#/$defs/Notifications"
        }
      }
    },
    "ReturnShipmentInformation": {
      "allOf": [
        {
          "$ref": "#/$defs/ShipmentInformation"
        },
        {
          "type": "object",
          "properties": {
            "serviceId": {
              "type": "string",
              "enum": [
                "PurolatorExpress",
                "PurolatorExpress10:30AM",
                "PurolatorExpress12PM",
                "PurolatorExpress9AM",
                "PurolatorExpressEvening",
                "PurolatorExpressInternational",
                "PurolatorExpressInternational10:30AM",
                "PurolatorExpressInternational12PM",
                "PurolatorExpressInternational9AM",
                "PurolatorExpressU.S.",
                "PurolatorExpressU.S.10:30AM",
                "PurolatorExpressU.S.12PM",
                "PurolatorExpressU.S.9AM",
                "PurolatorExpressBox",
                "PurolatorExpressBox10:30AM",
                "PurolatorExpressBox12PM",
                "PurolatorExpressBox9AM",
                "PurolatorExpressBoxEvening",
                "PurolatorExpressBoxInternational",
                "PurolatorExpressBoxU.S.",
                "PurolatorExpressBoxInternational10:30AM",
                "PurolatorExpressBoxInternational12PM",
                "PurolatorExpressBoxInternational9AM",
                "PurolatorExpressBoxU.S.10:30AM",
                "PurolatorExpressBoxU.S.12PM",
                "PurolatorExpressBoxU.S.9AM",
                "PurolatorExpressEnvelope",
                "PurolatorExpressEnvelope10:30AM",
                "PurolatorExpressEnvelope12PM",
                "PurolatorExpressEnvelope9AM",
                "PurolatorExpressEnvelopeEvening",
                "PurolatorExpressEnvelopeInternational",
                "PurolatorExpressEnvelopeU.S.",
                "PurolatorExpressEnvelopeInternational10:30AM",
                "PurolatorExpressEnvelopeInternational12PM",
                "PurolatorExpressEnvelopeInternational9AM",
                "PurolatorExpressEnvelopeU.S.10:30AM",
                "PurolatorExpressEnvelopeU.S.12PM",
                "PurolatorExpressEnvelopeU.S.9AM",
                "PurolatorExpressPack",
                "PurolatorExpressPack10:30AM",
                "PurolatorExpressPack12PM",
                "PurolatorExpressPack9AM",
                "PurolatorExpressPackEvening",
                "PurolatorExpressPackInternational",
                "PurolatorExpressPackInternational10:30AM",
                "PurolatorExpressPackInternational12PM",
                "PurolatorExpressPackInternational9AM",
                "PurolatorExpressPackU.S.",
                "PurolatorExpressPackU.S.10:30AM",
                "PurolatorExpressPackU.S.12PM",
                "PurolatorExpressPackU.S.9AM",
                "PurolatorGround",
                "PurolatorGround10:30AM",
                "PurolatorGround9AM",
                "PurolatorGroundEvening",
                "PurolatorGroundU.S.",
                "PurolatorQuickShip",
                "PurolatorStandard",
                "PurolatorExpressReturn",
                "PurolatorGroundReturn",
                "PurolatorDeferredReturn"
              ],
              "description": "Return or RMS service. Includes dedicated return products PurolatorExpressReturn, PurolatorGroundReturn, PurolatorDeferredReturn."
            }
          }
        }
      ]
    },
    "SenderInformation": {
      "type": "object",
      "properties": {
        "companyName": {
          "type": "string",
          "maxLength": 40,
          "description": "Company name."
        },
        "attentionTo": {
          "type": "string",
          "maxLength": 40,
          "description": "Attention to / contact name."
        },
        "streetAddress": {
          "type": "array",
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "type": "string",
            "maxLength": 40
          },
          "description": "Maximum 3 address lines. Each line has a max length of 40 characters."
        },
        "city": {
          "type": "string",
          "maxLength": 40,
          "description": "City."
        },
        "provinceStateCode": {
          "type": "string",
          "maxLength": 40,
          "description": "2-character province/state code. Required for Canadian and US addresses. Canadian provinces: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT. US states: AL, AK, AZ, AR, CA, CO, CT, 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, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY."
        },
        "country": {
          "type": "string",
          "maxLength": 2,
          "enum": [
            "CA"
          ],
          "description": "2-character country code. Sender must be CA."
        },
        "postalZipCode": {
          "type": "string",
          "maxLength": 10,
          "description": "Canadian postal code, US ZIP code, or international postal code."
        },
        "phoneNumber": {
          "type": "string",
          "maxLength": 15,
          "description": "Phone number, 10-15 digits. Conditionally required."
        }
      },
      "required": [
        "city",
        "provinceStateCode",
        "country",
        "postalZipCode"
      ]
    },
    "ShipmentDate": {
      "type": "string",
      "format": "date",
      "description": "Date of shipment. Up to 10 days in advance. Date format: YYYY-MM-DD. If not present, defaults to today's date (America/Toronto)."
    },
    "ShipmentDocuments": {
      "type": "object",
      "required": [
        "label"
      ],
      "properties": {
        "label": {
          "$ref": "#/$defs/Label"
        }
      }
    },
    "ShipmentInformation": {
      "type": "object",
      "required": [
        "serviceId",
        "totalWeight",
        "totalPackages"
      ],
      "properties": {
        "serviceId": {
          "type": "string",
          "enum": [
            "PurolatorExpress",
            "PurolatorExpress10:30AM",
            "PurolatorExpress12PM",
            "PurolatorExpress9AM",
            "PurolatorExpressEvening",
            "PurolatorExpressInternational",
            "PurolatorExpressInternational10:30AM",
            "PurolatorExpressInternational12PM",
            "PurolatorExpressInternational9AM",
            "PurolatorExpressU.S.",
            "PurolatorExpressU.S.10:30AM",
            "PurolatorExpressU.S.12PM",
            "PurolatorExpressU.S.9AM",
            "PurolatorExpressBox",
            "PurolatorExpressBox10:30AM",
            "PurolatorExpressBox12PM",
            "PurolatorExpressBox9AM",
            "PurolatorExpressBoxEvening",
            "PurolatorExpressBoxInternational",
            "PurolatorExpressBoxU.S.",
            "PurolatorExpressBoxInternational10:30AM",
            "PurolatorExpressBoxInternational12PM",
            "PurolatorExpressBoxInternational9AM",
            "PurolatorExpressBoxU.S.10:30AM",
            "PurolatorExpressBoxU.S.12PM",
            "PurolatorExpressBoxU.S.9AM",
            "PurolatorExpressEnvelope",
            "PurolatorExpressEnvelope10:30AM",
            "PurolatorExpressEnvelope12PM",
            "PurolatorExpressEnvelope9AM",
            "PurolatorExpressEnvelopeEvening",
            "PurolatorExpressEnvelopeInternational",
            "PurolatorExpressEnvelopeU.S.",
            "PurolatorExpressEnvelopeInternational10:30AM",
            "PurolatorExpressEnvelopeInternational12PM",
            "PurolatorExpressEnvelopeInternational9AM",
            "PurolatorExpressEnvelopeU.S.10:30AM",
            "PurolatorExpressEnvelopeU.S.12PM",
            "PurolatorExpressEnvelopeU.S.9AM",
            "PurolatorExpressPack",
            "PurolatorExpressPack10:30AM",
            "PurolatorExpressPack12PM",
            "PurolatorExpressPack9AM",
            "PurolatorExpressPackEvening",
            "PurolatorExpressPackInternational",
            "PurolatorExpressPackInternational10:30AM",
            "PurolatorExpressPackInternational12PM",
            "PurolatorExpressPackInternational9AM",
            "PurolatorExpressPackU.S.",
            "PurolatorExpressPackU.S.10:30AM",
            "PurolatorExpressPackU.S.12PM",
            "PurolatorExpressPackU.S.9AM",
            "PurolatorGround",
            "PurolatorGround10:30AM",
            "PurolatorGround9AM",
            "PurolatorGroundEvening",
            "PurolatorGroundU.S.",
            "PurolatorQuickShip",
            "PurolatorStandard"
          ],
          "description": "Courier service. Case-insensitive."
        },
        "unitOfMeasurement": {
          "type": "string",
          "enum": [
            "METRIC",
            "IMPERIAL"
          ],
          "description": "Imperial uses lb/in; metric uses kg/cm. Defaults to imperial if omitted."
        },
        "descriptionOfGoods": {
          "type": "string",
          "maxLength": 50
        },
        "totalWeight": {
          "type": "number",
          "format": "double",
          "description": "Total shipment weight. Recalculated from packageInformation when that array is present."
        },
        "totalPackages": {
          "type": "integer",
          "description": "Total number of pieces. Set from packageInformation length when that array is present."
        },
        "dangerousGoodsDeclarationDocumentIndicator": {
          "type": "boolean",
          "default": false
        },
        "declaredValue": {
          "type": "number",
          "format": "double"
        },
        "internationalOrderNumber": {
          "type": "string",
          "maxLength": 20,
          "description": "ICP shipment-level international order number. Used when provided; otherwise generated for ICP shipments whose brokerage provider is not No Broker/Other."
        },
        "codAmount": {
          "type": "number",
          "format": "double"
        },
        "specialInstructions": {
          "type": "string",
          "maxLength": 250
        },
        "shipmentOptionsInformation": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ShipmentOptionIdValuePair"
          }
        },
        "packageInformation": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PackageInformation"
          }
        }
      }
    },
    "ShipmentOptionIdValuePair": {
      "type": "object",
      "properties": {
        "optionId": {
          "type": "string",
          "enum": [
            "AdultSignatureRequired",
            "ChainOfSignature",
            "DangerousGoods",
            "DangerousGoodsClass",
            "DangerousGoodsMode",
            "DeclaredValue",
            "ExpressCheque",
            "ExpressChequeMethodOfPayment",
            "ExpressChequeAmount",
            "HealthCare",
            "HoldForPickup",
            "OriginSignatureNotRequired",
            "ResidentialSignatureDomestic",
            "ResidentialSignatureIntl",
            "SaturdayDelivery",
            "SaturdayPickup",
            "SundayDelivery",
            "SundayPickup",
            "ReturnPickup",
            "PackageFree",
            "OpenVerify"
          ],
          "maxLength": 30,
          "description": "Shipment option identifier. Case-insensitive."
        },
        "optionIdValue": {
          "type": "string",
          "maxLength": 30,
          "description": "Value for the option. Conditionally required depending on optionId. Typical values: true, false, Air, Ground, FullyRegulated, UN3373, UN1845, LessThan500kgExempt, LimitedQuantities. ExpressChequeAmount is numeric."
        }
      }
    },
    "Subscription": {
      "type": "object",
      "required": [
        "email"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 70,
          "description": "Mandatory when notificationId is NotifyWhenExceptionOccurs, NotifyWhenDeliveryOccurs, ShipmentConfirmation-Requester, or ShipmentNotification-Receiver."
        },
        "email": {
          "type": "string",
          "format": "email",
          "maxLength": 70
        },
        "notificationType": {
          "$ref": "#/$defs/NotificationType"
        }
      }
    },
    "ThirdPartyBillingInformation": {
      "type": "object",
      "properties": {
        "companyName": {
          "type": "string",
          "maxLength": 40,
          "description": "Company name."
        },
        "attentionTo": {
          "type": "string",
          "maxLength": 40,
          "description": "Attention to / contact name."
        },
        "streetAddress": {
          "type": "array",
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "type": "string",
            "maxLength": 40
          },
          "description": "Maximum 3 address lines. Each line has a max length of 40 characters."
        },
        "city": {
          "type": "string",
          "maxLength": 40,
          "description": "City."
        },
        "provinceStateCode": {
          "type": "string",
          "maxLength": 40,
          "description": "2-character province/state code. Required for Canadian and US addresses. Canadian provinces: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT. US states: AL, AK, AZ, AR, CA, CO, CT, 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, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY."
        },
        "country": {
          "type": "string",
          "maxLength": 2,
          "enum": [
            "AD",
            "AE",
            "AF",
            "AG",
            "AI",
            "AL",
            "AM",
            "AN",
            "AO",
            "AQ",
            "AR",
            "AS",
            "AT",
            "AU",
            "AW",
            "AX",
            "AZ",
            "BA",
            "BB",
            "BD",
            "BE",
            "BF",
            "BG",
            "BH",
            "BI",
            "BJ",
            "BL",
            "BM",
            "BN",
            "BO",
            "BR",
            "BS",
            "BT",
            "BV",
            "BW",
            "BY",
            "BZ",
            "CA",
            "CC",
            "CD",
            "CF",
            "CG",
            "CH",
            "CI",
            "CK",
            "CL",
            "CM",
            "CN",
            "CO",
            "CR",
            "CU",
            "CV",
            "CX",
            "CY",
            "CZ",
            "DE",
            "DJ",
            "DK",
            "DM",
            "DO",
            "DZ",
            "EC",
            "EE",
            "EG",
            "EH",
            "ER",
            "ES",
            "ET",
            "EU",
            "FI",
            "FJ",
            "FK",
            "FM",
            "FO",
            "FR",
            "GA",
            "GB",
            "GD",
            "GE",
            "GF",
            "GG",
            "GH",
            "GI",
            "GL",
            "GM",
            "GN",
            "GP",
            "GQ",
            "GR",
            "GS",
            "GT",
            "GU",
            "GW",
            "GY",
            "HK",
            "HM",
            "HN",
            "HR",
            "HT",
            "HU",
            "IC",
            "ID",
            "IE",
            "IL",
            "IM",
            "IN",
            "IO",
            "IQ",
            "IR",
            "IS",
            "IT",
            "JE",
            "JM",
            "JO",
            "JP",
            "KE",
            "KG",
            "KH",
            "KI",
            "KM",
            "KN",
            "KP",
            "KR",
            "KW",
            "KY",
            "KZ",
            "LA",
            "LB",
            "LC",
            "LI",
            "LK",
            "LR",
            "LS",
            "LT",
            "LU",
            "LV",
            "LY",
            "MA",
            "MC",
            "MD",
            "ME",
            "MG",
            "MH",
            "MK",
            "ML",
            "MM",
            "MN",
            "MO",
            "MP",
            "MQ",
            "MR",
            "MS",
            "MT",
            "MU",
            "MV",
            "MW",
            "MX",
            "MY",
            "MZ",
            "NA",
            "NC",
            "NE",
            "NF",
            "NG",
            "NI",
            "NL",
            "NO",
            "NP",
            "NR",
            "NT",
            "NU",
            "NZ",
            "OM",
            "OR",
            "PA",
            "PE",
            "PF",
            "PG",
            "PH",
            "PK",
            "PL",
            "PM",
            "PN",
            "PR",
            "PS",
            "PT",
            "PW",
            "PY",
            "QA",
            "RE",
            "RO",
            "RS",
            "RU",
            "RW",
            "SA",
            "SB",
            "SC",
            "SD",
            "SE",
            "SG",
            "SH",
            "SI",
            "SJ",
            "SK",
            "SL",
            "SM",
            "SN",
            "SO",
            "SR",
            "ST",
            "SV",
            "SY",
            "SZ",
            "TC",
            "TD",
            "TF",
            "TG",
            "TH",
            "TJ",
            "TK",
            "TL",
            "TM",
            "TN",
            "TO",
            "TP",
            "TR",
            "TT",
            "TV",
            "TW",
            "TZ",
            "UA",
            "UG",
            "UM",
            "UN",
            "US",
            "UY",
            "UZ",
            "VA",
            "VC",
            "VE",
            "VG",
            "VI",
            "VN",
            "VU",
            "WF",
            "WS",
            "XB",
            "XC",
            "XE",
            "XM",
            "XN",
            "XS",
            "XY",
            "YE",
            "YT",
            "ZA",
            "ZM",
            "ZW",
            "ZZ"
          ],
          "description": "2-character country code."
        },
        "postalZipCode": {
          "type": "string",
          "maxLength": 10,
          "description": "Canadian postal code, US ZIP code, or international postal code."
        },
        "phoneNumber": {
          "type": "string",
          "maxLength": 15,
          "description": "Phone number, 10-15 digits. Conditionally required."
        }
      },
      "required": [
        "city",
        "provinceStateCode",
        "country",
        "postalZipCode"
      ]
    },
    "USOriginInformation": {
      "type": "object",
      "properties": {
        "companyName": {
          "type": "string",
          "maxLength": 40,
          "description": "Company name."
        },
        "attentionTo": {
          "type": "string",
          "maxLength": 40,
          "description": "Attention to / contact name."
        },
        "streetAddress": {
          "type": "array",
          "minItems": 1,
          "maxItems": 3,
          "items": {
            "type": "string",
            "maxLength": 40
          },
          "description": "Maximum 3 address lines. Each line has a max length of 40 characters."
        },
        "city": {
          "type": "string",
          "maxLength": 40,
          "description": "City."
        },
        "provinceStateCode": {
          "type": "string",
          "maxLength": 40,
          "description": "2-character province/state code. Required for Canadian and US addresses. Canadian provinces: AB, BC, MB, NB, NL, NS, NT, NU, ON, PE, QC, SK, YT. US states: AL, AK, AZ, AR, CA, CO, CT, 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, RI, SC, SD, TN, TX, UT, VT, VA, WA, WV, WI, WY."
        },
        "country": {
          "type": "string",
          "enum": [
            "US"
          ],
          "description": "Must be US for US-origin shipments (not required for RMS)."
        },
        "postalZipCode": {
          "type": "string",
          "maxLength": 10,
          "description": "Canadian postal code, US ZIP code, or international postal code."
        },
        "phoneNumber": {
          "type": "string",
          "maxLength": 15,
          "description": "Phone number, 10-15 digits. Conditionally required."
        }
      },
      "required": [
        "city",
        "provinceStateCode",
        "country",
        "postalZipCode"
      ]
    }
  }
}