{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-cancel-purequest-schema.json",
  "title": "CancelPURequest",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dhl-mydhl-api-xml-dhl-express-openapi.yml#/components/schemas/CancelPURequest",
  "type": "object",
  "properties": {
    "Request": {
      "$ref": "#/$defs/Request"
    },
    "RegionCode": {
      "$ref": "#/$defs/RegionCode"
    },
    "ConfirmationNumber": {
      "type": "string",
      "description": "Confirmation number of the pickup that needs to be canceled",
      "maxLength": 15
    },
    "RequestorName": {
      "type": "string",
      "description": "Name of the requestor",
      "maxLength": 35
    },
    "CountryCode": {
      "$ref": "#/$defs/CountryCode"
    },
    "OriginSvcArea": {
      "type": "string",
      "description": "Three letter code identifying the service area of origin. This field is not returned for cancel pickup request",
      "minLength": 3,
      "maxLength": 3
    },
    "Reason": {
      "type": "string",
      "description": "\n\t\t\t\t\t\t\t001   PACKAGE_NOT_READY\n\t\t\t\t\t\t\t002     RATES_TOO_HIGH\n\t\t\t\t\t\t\t003    TRANSIT_TIME_TOO_SLOW\n\t\t\t\t\t\t\t004    TAKE_TO_SERVICE_CENTER_OR_DROP_BOX\n\t\t\t\t\t\t\t005    COMMITMENT_TIME_NOT_MET\n\t\t\t\t\t\t\t006    REASON_NOT_GIVEN\n\t\t\t\t\t\t\t007    OTHER\n\t\t\t\t\t\t\t008    PICKUP_MODIFIED\n\t\t\t\t\t\t",
      "minLength": 3,
      "maxLength": 3,
      "enum": [
        "001",
        "002",
        "003",
        "004",
        "005",
        "006",
        "007",
        "008"
      ]
    },
    "PickupDate": {
      "type": "string",
      "description": "Date of pickup",
      "format": "date"
    },
    "CancelTime": {
      "$ref": "#/$defs/TimeHM"
    }
  },
  "required": [
    "Request",
    "ConfirmationNumber",
    "RequestorName",
    "CountryCode",
    "OriginSvcArea",
    "PickupDate",
    "CancelTime"
  ],
  "$defs": {
    "CountryCode": {
      "type": "string",
      "description": "ISO country codes",
      "minLength": 2,
      "maxLength": 2
    },
    "MessageReference": {
      "type": "string",
      "description": "Reference to the requested Message",
      "minLength": 28,
      "maxLength": 32
    },
    "MetaData": {
      "type": "object",
      "description": "MetaData header",
      "properties": {
        "SoftwareName": {
          "type": "string",
          "description": "The Software Name element is used to identify the software name used by customer or third party vendor. It is mandatory field",
          "maxLength": 30
        },
        "SoftwareVersion": {
          "type": "string",
          "description": "The Software Version element is used to identify the software version used by customer or third party vendor. It is mandatory field",
          "maxLength": 10
        }
      },
      "required": [
        "SoftwareName",
        "SoftwareVersion"
      ]
    },
    "Password": {
      "type": "string",
      "description": "Password used for verifying the sender",
      "minLength": 8,
      "maxLength": 20
    },
    "RegionCode": {
      "type": "string",
      "description": "RegionCode",
      "minLength": 2,
      "maxLength": 2,
      "enum": [
        "AP",
        "EU",
        "AM"
      ]
    },
    "Request": {
      "type": "object",
      "description": "Generic request header",
      "properties": {
        "ServiceHeader": {
          "$ref": "#/$defs/ServiceHeader"
        },
        "MetaData": {
          "$ref": "#/$defs/MetaData"
        }
      },
      "required": [
        "ServiceHeader"
      ]
    },
    "ServiceHeader": {
      "type": "object",
      "description": "Standard routing header",
      "properties": {
        "MessageTime": {
          "type": "string",
          "description": "Time this message is sent",
          "format": "date-time"
        },
        "GMTOffset": {
          "type": "string",
          "description": "The GMToffset element is a simple type of element which gives the time difference between the service areas time and GMT"
        },
        "MessageReference": {
          "$ref": "#/$defs/MessageReference"
        },
        "SiteID": {
          "$ref": "#/$defs/SiteID"
        },
        "Password": {
          "$ref": "#/$defs/Password"
        }
      },
      "required": [
        "MessageTime",
        "MessageReference",
        "SiteID",
        "Password"
      ]
    },
    "SiteID": {
      "type": "string",
      "description": "Site ID used for verifying the sender",
      "minLength": 6,
      "maxLength": 20
    },
    "TimeHM": {
      "type": "string",
      "description": "Time in hours and minutes (HH:MM)",
      "format": "time"
    }
  }
}