{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-shipment-tracking-get-response-schema.json",
  "title": "ShipmentTracking_GET_response",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dhl-shipment-tracking-v2-dhl-global-forwarding-openapi.yml#/components/schemas/ShipmentTracking_GET_response",
  "required": [
    "shipmentTracking"
  ],
  "type": "object",
  "properties": {
    "shipmentTracking": {
      "$ref": "#/$defs/ShipmentTracking"
    }
  },
  "$defs": {
    "Shipment": {
      "required": [
        "destination",
        "housebillNumber",
        "modeOfTransport",
        "origin",
        "phase",
        "timestamps",
        "totalVolume",
        "totalVolumeUom",
        "totalWeight",
        "totalWeightUom",
        "transportLegs"
      ],
      "type": "object",
      "properties": {
        "housebillNumber": {
          "maxLength": 35,
          "type": "string",
          "description": "Housebill Number"
        },
        "externalBookingID": {
          "maxLength": 35,
          "type": "string",
          "description": "Identification assigned by an external party for the booking made with DGF. It will only be visible when using the same reference number from the request parameter. The ExternalBookingID can be populated by mapping a reference number to the externalBookingID field in the shipment booking API."
        },
        "phase": {
          "maxLength": 20,
          "type": "string",
          "description": "Transit Status with possible values of:\n - BookingCreated\n - Planned\n - InTransit\n - Completed\n - Cancelled\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "origin": {
          "$ref": "#/$defs/origin"
        },
        "destination": {
          "$ref": "#/$defs/destination"
        },
        "shipper": {
          "required": [
            "name"
          ],
          "type": "object",
          "description": "Shipper Details.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User",
          "properties": {
            "accountNumber": {
              "type": "string",
              "description": "Shipper organization code'"
            },
            "name": {
              "type": "string",
              "description": "The company who is to sending the goods being transported"
            },
            "address": {
              "required": [
                "addressLine1"
              ],
              "type": "object",
              "properties": {
                "addressLine1": {
                  "type": "string"
                },
                "addressLine2": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "stateProvince": {
                  "type": "string"
                },
                "countryCode": {
                  "type": "string",
                  "description": "Use 'CountryCode' code list, see https://api-sandbox.dhl.com/dgff/transportation/shipment-booking/codelist?codeListID=CountryCode"
                }
              }
            }
          }
        },
        "consignee": {
          "required": [
            "name"
          ],
          "type": "object",
          "description": "Consignee Details.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User",
          "properties": {
            "accountNumber": {
              "type": "string",
              "description": "Consignee organization code"
            },
            "name": {
              "type": "string",
              "description": "The company who is to receive the goods being transported"
            },
            "address": {
              "required": [
                "addressLine1"
              ],
              "type": "object",
              "properties": {
                "addressLine1": {
                  "type": "string"
                },
                "addressLine2": {
                  "type": "string"
                },
                "postalCode": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "stateProvince": {
                  "type": "string"
                },
                "countryCode": {
                  "type": "string",
                  "description": "Country code."
                }
              }
            }
          }
        },
        "modeOfTransport": {
          "maxLength": 3,
          "type": "string",
          "description": "Transport mode."
        },
        "totalPackages": {
          "type": "string",
          "description": "Total number of packages."
        },
        "totalWeight": {
          "type": "string",
          "description": "Total Shipment Weight."
        },
        "totalWeightUom": {
          "maxLength": 3,
          "minLength": 0,
          "type": "string",
          "description": "Total Shipment weight uom - default to KGM (kilograms)."
        },
        "totalVolume": {
          "type": "number",
          "description": "Total Shipment volume.",
          "format": "double"
        },
        "totalVolumeUom": {
          "maxLength": 3,
          "minLength": 0,
          "type": "string",
          "description": "Total Shipment volume uom - default to MTQ (cubic meters)."
        },
        "totalChargeable": {
          "type": "number",
          "description": "Chargeable Weight.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "totalChargeableUom": {
          "maxLength": 3,
          "minLength": 0,
          "type": "string",
          "description": "Chargeable Weight uom - default to MTQ (cubic meters).\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "serviceCode": {
          "maxLength": 50,
          "type": "string",
          "description": "Service code."
        },
        "serviceProduct": {
          "maxLength": 50,
          "type": "string",
          "description": "Service/Product name."
        },
        "paymentTerms": {
          "type": "string",
          "description": "Payment Terms."
        },
        "expressBOLFlag": {
          "type": "boolean",
          "description": "Applicable to Ocean\n\nPossible values:\ntrue - Express BOL\nfalse - Standard BOL."
        },
        "warehouseUpdateFlag": {
          "type": "boolean",
          "description": "[For future use] Warehouse update flag"
        },
        "incoterms": {
          "maxLength": 3,
          "type": "string",
          "description": "Maintained by the International Chamber of Commerce (ICC), this codification of terms is used in foreign trade contracts to define which parties incur the costs and at what specific point the costs are incurred.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "goodsDescription": {
          "maxLength": 40,
          "type": "string",
          "description": "Description of goods.\\n\\n[Available for Registered User only]\\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "status": {
          "maxLength": 20,
          "type": "string",
          "description": "Delayed/On Time Status with possible values of:\n - Delayed\n - OnTime\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "lastEvent": {
          "$ref": "#/$defs/lastEvent"
        },
        "timestamps": {
          "$ref": "#/$defs/timestamps"
        },
        "masterbills": {
          "type": "array",
          "description": "Masterbill details.\\n\\n[Available for Registered User only]\\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User",
          "items": {
            "$ref": "#/$defs/masterbills"
          }
        },
        "transportUnits": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/transportUnits"
          }
        },
        "transportLegs": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/transportLegs"
          }
        },
        "exceptions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/exceptions"
          }
        },
        "references": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/references"
          }
        },
        "emissions": {
          "$ref": "#/$defs/emissions"
        }
      }
    },
    "ShipmentTracking": {
      "required": [
        "shipment"
      ],
      "type": "object",
      "properties": {
        "queryID": {
          "type": "string",
          "description": "Query ID"
        },
        "queryIDType": {
          "type": "string",
          "description": "Query ID Type"
        },
        "shipment": {
          "$ref": "#/$defs/Shipment"
        }
      }
    },
    "carrier": {
      "required": [
        "name"
      ],
      "type": "object",
      "properties": {
        "name": {
          "maxLength": 200,
          "type": "string",
          "description": "Name of firm that provides transportation services.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "standardCarrierCode": {
          "maxLength": 4,
          "type": "string",
          "description": "Carrier SCAC code.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "bookingReference": {
          "maxLength": 20,
          "type": "string",
          "description": "Carrier booking reference.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        }
      }
    },
    "destination": {
      "required": [
        "locationCode"
      ],
      "type": "object",
      "properties": {
        "airportCode": {
          "maxLength": 3,
          "type": "string",
          "description": "Destination location code in IATA or three-character DHL station code format."
        },
        "locationCode": {
          "maxLength": 5,
          "type": "string",
          "description": "Destination location code in UNLOCODE or five-character DHL station code format."
        },
        "locationName": {
          "maxLength": 50,
          "type": "string",
          "description": "Destination location name."
        }
      }
    },
    "emissions": {
      "type": "object",
      "properties": {
        "distance": {
          "required": [
            "totalDistance",
            "uom"
          ],
          "type": "object",
          "properties": {
            "uom": {
              "type": "string",
              "description": "KMT = Kilometer"
            },
            "pickup": {
              "type": "string"
            },
            "mainHaul": {
              "type": "string"
            },
            "delivery": {
              "type": "string"
            },
            "totalDistance": {
              "type": "string"
            }
          },
          "description": "Distance"
        },
        "primaryEnergy": {
          "required": [
            "totalWellToWheel",
            "uom"
          ],
          "type": "object",
          "properties": {
            "uom": {
              "type": "string",
              "description": "3B = Megajoule"
            },
            "totalTankToWheel": {
              "type": "string"
            },
            "totalWellToWheel": {
              "type": "string"
            }
          },
          "description": "Energy Consumption"
        },
        "carbonDioxideEquivalents": {
          "required": [
            "totalTankToWheel",
            "totalWellToWheel",
            "uom"
          ],
          "type": "object",
          "properties": {
            "uom": {
              "type": "string",
              "description": "TNE = Metric ton"
            },
            "pickupTankToWheel": {
              "type": "string"
            },
            "pickupWellToWheel": {
              "type": "string"
            },
            "mainHaulTankToWheel": {
              "type": "string"
            },
            "mainHaulWellToWheel": {
              "type": "string"
            },
            "deliveryTankToWheel": {
              "type": "string"
            },
            "deliveryWellToWheel": {
              "type": "string"
            },
            "stationHandlingTankToWheel": {
              "type": "string"
            },
            "stationHandlingWellToWheel": {
              "type": "string"
            },
            "totalTankToWheel": {
              "type": "string"
            },
            "totalWellToWheel": {
              "type": "string"
            }
          },
          "description": "Greenhouse Gases"
        },
        "nitrogenOxides": {
          "required": [
            "totalWellToWheel",
            "uom"
          ],
          "type": "object",
          "properties": {
            "uom": {
              "type": "string",
              "description": "KGM = Kilogram"
            },
            "totalTankToWheel": {
              "type": "string"
            },
            "totalWellToWheel": {
              "type": "string"
            }
          },
          "description": "Pollutants - Nitrogen Oxides"
        },
        "sulfurDioxides": {
          "required": [
            "totalWellToWheel",
            "uom"
          ],
          "type": "object",
          "properties": {
            "uom": {
              "type": "string",
              "description": "KGM = Kilogram"
            },
            "totalTankToWheel": {
              "type": "string"
            },
            "totalWellToWheel": {
              "type": "string"
            }
          },
          "description": "Pollutants - Sulphur Dioxide"
        },
        "nonMethaneHydrocarbons": {
          "required": [
            "totalWellToWheel",
            "uom"
          ],
          "type": "object",
          "properties": {
            "uom": {
              "type": "string",
              "description": "KGM = Kilogram"
            },
            "totalTankToWheel": {
              "type": "string"
            },
            "totalWellToWheel": {
              "type": "string"
            }
          },
          "description": "Pollutants - Non-methane Hydrocarbons"
        },
        "particles": {
          "required": [
            "totalWellToWheel",
            "uom"
          ],
          "type": "object",
          "properties": {
            "uom": {
              "type": "string",
              "description": "KGM = Kilogram"
            },
            "totalTankToWheel": {
              "type": "string"
            },
            "totalWellToWheel": {
              "type": "string"
            }
          },
          "description": "Pollutants - Particulate Matter"
        }
      }
    },
    "exceptions": {
      "type": "object",
      "properties": {
        "exceptionCode": {
          "type": "string",
          "description": "Exception type.\n\n[Available for Registered User only] For more information, please refer to Get Started → User Guide → Additional Information → Exception type Codes List. Please reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "exceptionDescription": {
          "type": "string",
          "description": "Exception type.\n\n[Available for Registered User only] For more information, please refer to Get Started → User Guide → Additional Information → Exception type Codes List. Please reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "exceptionType": {
          "type": "string",
          "description": "Exception type.\n\n[Available for Registered User only] For more information, please refer to Get Started → User Guide → Additional Information → Exception Category Codes List.     Please reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "exceptionDateTime": {
          "type": "string",
          "description": "Exception timestamp.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "closureDateTime": {
          "type": "string",
          "description": "Exception closure timestamp.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "remarks": {
          "type": "string",
          "description": "Exception remarks.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "responsibleParty": {
          "type": "string",
          "description": "Responsible Party for this exception.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        }
      }
    },
    "lastEvent": {
      "type": "object",
      "properties": {
        "timestampCode": {
          "type": "string",
          "description": "Status Code. \nPlease refer to [Additional Information - Code List](https://developer.dhl.com/api-reference/dgf-shipment-tracking#get-started-section/user-guide--additional-information) for the Air, Ocean, Road, Rail timestamp codes. If milestones are not included in the code list, then the TimestampCode will not be available."
        },
        "timestampDescription": {
          "type": "string",
          "description": "Last Known Event Description."
        },
        "timestampDateTime": {
          "type": "string",
          "description": "Last Known Event Date/Time."
        },
        "locationCode": {
          "maxLength": 60,
          "minLength": 5,
          "type": "string",
          "description": "Last Known Event Location Code."
        },
        "locationName": {
          "maxLength": 50,
          "type": "string",
          "description": "Last Known Event Location name."
        }
      }
    },
    "masterbills": {
      "required": [
        "masterbillNumber"
      ],
      "type": "object",
      "properties": {
        "masterbillNumber": {
          "maxLength": 35,
          "type": "string",
          "description": "Masterbill Number\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "carrier": {
          "$ref": "#/$defs/carrier"
        }
      }
    },
    "origin": {
      "required": [
        "locationCode"
      ],
      "type": "object",
      "properties": {
        "airportCode": {
          "maxLength": 3,
          "type": "string",
          "description": "Origin location code in IATA or three-character DHL station code format."
        },
        "locationCode": {
          "maxLength": 5,
          "type": "string",
          "description": "Origin location code in UNLOCODE or five-character DHL station code format."
        },
        "locationName": {
          "maxLength": 50,
          "type": "string",
          "description": "Origin location name."
        }
      }
    },
    "portOfLoading": {
      "required": [
        "locationCode"
      ],
      "type": "object",
      "properties": {
        "airportCode": {
          "maxLength": 3,
          "type": "string",
          "description": "Port of loading code in IATA code format."
        },
        "locationCode": {
          "maxLength": 5,
          "type": "string",
          "description": "Port of loading code in UNLOCODE code format."
        },
        "locationName": {
          "maxLength": 50,
          "type": "string",
          "description": "Port of loading location name."
        }
      },
      "description": "This group is Applicable to OCEAN."
    },
    "portOfUnloading": {
      "required": [
        "locationCode"
      ],
      "type": "object",
      "properties": {
        "airportCode": {
          "maxLength": 3,
          "minLength": 3,
          "type": "string",
          "description": "Port of unloading in IATA code format."
        },
        "locationCode": {
          "maxLength": 5,
          "minLength": 5,
          "type": "string",
          "description": "Port of unloading in UNLOCODE code format."
        },
        "locationName": {
          "maxLength": 50,
          "type": "string",
          "description": "Port of unloading location name."
        }
      },
      "description": "This group is Applicable to OCEAN."
    },
    "references": {
      "required": [
        "number",
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Reference type.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "number": {
          "type": "string",
          "description": "Reference number.\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        }
      }
    },
    "timestamps": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "timestampCode": {
            "type": "string",
            "description": "Status Code. \nPlease refer to [Additional Information - Code List](https://developer.dhl.com/api-reference/dgf-shipment-tracking#get-started-section/user-guide--additional-information) for the Air, Ocean, Road, Rail timestamp codes"
          },
          "timestampDescription": {
            "type": "string",
            "description": "Textual description of status. Returned from earliest to latest."
          },
          "timestampDateTime": {
            "type": "string",
            "description": "Local Date Time."
          },
          "locationCode": {
            "maxLength": 5,
            "type": "string",
            "description": "UNLOCODE."
          },
          "locationName": {
            "maxLength": 50,
            "type": "string",
            "description": "Event location name."
          },
          "journeyID": {
            "maxLength": 10,
            "type": "string",
            "description": "Flight Carrier and Number.\nApplicable to AIR\n\\n\\n[Available for Registered User only]\\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
          },
          "signatory": {
            "maxLength": 50,
            "type": "string",
            "description": "Signatory name for POD / A32.\n\\n\\n[Available for Registered User only]\\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
          },
          "remarks": {
            "type": "string",
            "description": "Remarks"
          }
        }
      }
    },
    "transportLegs": {
      "type": "object",
      "properties": {
        "vesselName": {
          "maxLength": 35,
          "type": "string",
          "description": "Vessel Name for Ocean. Applicable to OCEAN"
        },
        "vesselLloydsNumber": {
          "maxLength": 7,
          "type": "string",
          "description": "Lloyd's Register Number. Applicable to OCEAN"
        },
        "journeyID": {
          "maxLength": 10,
          "type": "string",
          "description": "Voyage number for Ocean. Flight Carrier and Number for Air"
        },
        "modeOfTransport": {
          "type": "string",
          "description": "Transport mode."
        },
        "legType(in testing)": {
          "type": "string",
          "description": "Leg type."
        },
        "portOfLoading": {
          "$ref": "#/$defs/portOfLoading"
        },
        "portOfUnloading": {
          "$ref": "#/$defs/portOfUnloading"
        },
        "estimatedDepartureDate": {
          "type": "string",
          "description": "Flight Estimated Date and Time of Departure."
        },
        "estimatedArrivalDate": {
          "type": "string",
          "description": "Flight Estimated Date and Time of Arrival."
        },
        "actualDepartureDate": {
          "type": "string",
          "description": "Flight Actual Date and Time of Departure."
        },
        "actualArrivalDate": {
          "type": "string",
          "description": "Flight Actual Date and Time of Arrival."
        }
      }
    },
    "transportUnits": {
      "required": [
        "transportUnitID"
      ],
      "type": "object",
      "description": "This group is Applicable to OCEAN.",
      "properties": {
        "transportUnitID": {
          "maxLength": 20,
          "type": "string",
          "description": "Container ID. Only available for FCL shipments."
        },
        "transportUnitType": {
          "maxLength": 4,
          "type": "string",
          "description": "Container Size/Type\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User"
        },
        "sealNumbers": {
          "type": "array",
          "description": "Seal numbers\n\n[Available for Registered User only]\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User",
          "items": {
            "type": "object"
          }
        },
        "timestamps": {
          "type": "array",
          "description": "Container timestamp.\\n\\n[Available for Registered User only]\\nPlease reach out to DGF API Support (dgf.apisupport@dhl.com) to be a Registered User",
          "items": {
            "type": "object",
            "properties": {
              "timestampCode": {
                "type": "string",
                "description": "Status Code. \nPlease refer to [Additional Information - Code List](https://developer.dhl.com/api-reference/dgf-shipment-tracking#get-started-section/user-guide--additional-information) for the Air, Ocean, Road, Rail timestamp codes"
              },
              "timestampDescription": {
                "type": "string",
                "description": "Textual description of status. Returned from earliest to latest."
              },
              "timestampDateTime": {
                "type": "string",
                "description": "Local Date Time."
              },
              "locationCode": {
                "maxLength": 5,
                "type": "string",
                "description": "UNLOCODE."
              },
              "locationName": {
                "maxLength": 50,
                "type": "string",
                "description": "Event location name."
              }
            }
          }
        }
      }
    }
  }
}