{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-pickup-order-status-schema.json",
  "title": "PickupOrderStatus",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dhl-dhl-parcel-de-pickup-post-parcel-germany-openapi.yml#/components/schemas/PickupOrderStatus",
  "type": "object",
  "properties": {
    "orderDetails": {
      "$ref": "#/$defs/OrderDetails"
    },
    "customerDetails": {
      "$ref": "#/$defs/CustomerDetails"
    },
    "pickupLocation": {
      "$ref": "#/$defs/PickupLocationId"
    },
    "businessHours": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TimeFrame"
      },
      "minItems": 0,
      "maxItems": 3
    },
    "contactPerson": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ContactPerson"
      },
      "minItems": 0,
      "maxItems": 2
    },
    "pickupDetails": {
      "$ref": "#/$defs/PickupDetails"
    },
    "shipmentDetails": {
      "$ref": "#/$defs/ShipmentDetailsWithState"
    },
    "feedback": {
      "type": "string"
    }
  },
  "required": [
    "orderDetails",
    "customerDetails",
    "pickupLocation",
    "pickupDetails",
    "shipmentDetails"
  ],
  "$defs": {
    "AccountNumber": {
      "type": "string",
      "pattern": "\\d{10}"
    },
    "AddressHouse": {
      "type": "string",
      "maxLength": 10
    },
    "AddressStreet": {
      "type": "string",
      "maxLength": 70
    },
    "AsId": {
      "type": "string",
      "description": "The pickup location id",
      "maxLength": 12,
      "minLength": 12,
      "pattern": "^AS[0-9]{10}$"
    },
    "BillingNumber": {
      "type": "string",
      "pattern": "\\d{10}\\d{2}\\w{2}"
    },
    "BulkService": {
      "type": "object",
      "properties": {
        "comment": {
          "type": "string",
          "maxLength": 50
        }
      },
      "required": [
        "comment"
      ]
    },
    "City": {
      "type": "string",
      "maxLength": 35
    },
    "ConsigneeAddress": {
      "type": "object",
      "properties": {
        "name1": {
          "$ref": "#/$defs/Name"
        },
        "name2": {
          "$ref": "#/$defs/Name"
        },
        "addressStreet": {
          "$ref": "#/$defs/AddressStreet"
        },
        "addressHouse": {
          "$ref": "#/$defs/AddressHouse"
        },
        "postalCode": {
          "$ref": "#/$defs/PostalCode"
        },
        "city": {
          "$ref": "#/$defs/City"
        },
        "country": {
          "$ref": "#/$defs/Country"
        },
        "state": {
          "$ref": "#/$defs/State"
        }
      },
      "required": [
        "name1",
        "postalCode",
        "city"
      ]
    },
    "ContactPerson": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 50
        },
        "phone": {
          "type": "string",
          "maxLength": 50
        },
        "email": {
          "type": "string",
          "maxLength": 250
        },
        "emailNotification": {
          "$ref": "#/$defs/EmailNotification"
        }
      }
    },
    "Country": {
      "type": "string",
      "minLength": 2,
      "maxLength": 2
    },
    "CustomerDetails": {
      "type": "object",
      "properties": {
        "accountNumber": {
          "$ref": "#/$defs/AccountNumber"
        },
        "billingNumber": {
          "$ref": "#/$defs/BillingNumber"
        }
      },
      "required": [
        "billingNumber"
      ]
    },
    "EmailNotification": {
      "type": "object",
      "properties": {
        "sendPickupConfirmationEmail": {
          "type": "boolean"
        },
        "sendPickupTimeWindowEmail": {
          "type": "boolean"
        }
      }
    },
    "FixedDate": {
      "type": "object",
      "properties": {
        "value": {
          "$ref": "#/$defs/SimpleDate"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "value"
      ]
    },
    "LabelService": {
      "type": "object",
      "properties": {
        "consignee": {
          "$ref": "#/$defs/ConsigneeAddress"
        }
      },
      "required": [
        "consignee"
      ]
    },
    "Name": {
      "type": "string",
      "maxLength": 50
    },
    "OrderDetails": {
      "type": "object",
      "properties": {
        "orderID": {
          "$ref": "#/$defs/OrderID"
        },
        "orderState": {
          "description": "Mögliche Rückgabewerte: ANGENOMMEN, STORNIERT, ABGELEHNT, ABGEHOLT, TEILABHOLUNG, NICHT_ABGEHOLT, IN_DURCHFUEHRUNG, IN_PRUEFUNG, FREIGABE, TEILBESTAETIGT",
          "type": "string"
        }
      },
      "required": [
        "orderID",
        "orderState"
      ]
    },
    "OrderID": {
      "type": "string",
      "minLength": 32,
      "maxLength": 32
    },
    "PickupASAP": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        }
      },
      "required": [
        "type"
      ]
    },
    "PickupAddress": {
      "type": "object",
      "properties": {
        "name1": {
          "$ref": "#/$defs/Name"
        },
        "name2": {
          "$ref": "#/$defs/Name"
        },
        "addressStreet": {
          "$ref": "#/$defs/AddressStreet"
        },
        "addressHouse": {
          "$ref": "#/$defs/AddressHouse"
        },
        "postalCode": {
          "$ref": "#/$defs/PostalCode"
        },
        "city": {
          "$ref": "#/$defs/City"
        },
        "country": {
          "$ref": "#/$defs/Country"
        },
        "state": {
          "$ref": "#/$defs/State"
        }
      },
      "required": [
        "name1",
        "addressStreet",
        "addressHouse",
        "postalCode",
        "city"
      ]
    },
    "PickupDetails": {
      "type": "object",
      "properties": {
        "pickupDate": {
          "oneOf": [
            {
              "$ref": "#/$defs/FixedDate"
            },
            {
              "$ref": "#/$defs/PickupASAP"
            }
          ]
        },
        "totalWeight": {
          "$ref": "#/$defs/Weight"
        },
        "comment": {
          "type": "string",
          "maxLength": 100
        }
      },
      "required": [
        "pickupDate"
      ]
    },
    "PickupLocationId": {
      "type": "object",
      "properties": {
        "id": {
          "$ref": "#/$defs/AsId"
        },
        "pickupAddress": {
          "$ref": "#/$defs/PickupAddress"
        }
      }
    },
    "PickupServices": {
      "type": "object",
      "properties": {
        "bulkyGood": {
          "$ref": "#/$defs/BulkService"
        },
        "printLabel": {
          "$ref": "#/$defs/LabelService"
        }
      }
    },
    "PostalCode": {
      "type": "string",
      "maxLength": 7
    },
    "Shipment": {
      "type": "object",
      "properties": {
        "transportationType": {
          "$ref": "#/$defs/TransportationType"
        },
        "replacement": {
          "type": "boolean"
        },
        "shipmentNo": {
          "type": "string"
        },
        "size": {
          "type": "string",
          "enum": [
            "S",
            "M",
            "L"
          ],
          "description": "mandatory if customerDetails.billingNumber is not set"
        },
        "pickupServices": {
          "$ref": "#/$defs/PickupServices"
        },
        "customerReference": {
          "type": "string",
          "maxLength": 20
        }
      },
      "required": [
        "transportationType"
      ]
    },
    "ShipmentDetailsWithState": {
      "type": "object",
      "properties": {
        "shipments": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/ShipmentWithState"
          }
        }
      }
    },
    "ShipmentState": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string"
        },
        "responseTime": {
          "$ref": "#/$defs/SimpleDateTime"
        },
        "actualPickupDate": {
          "$ref": "#/$defs/SimpleDate"
        }
      },
      "required": [
        "state"
      ]
    },
    "ShipmentWithState": {
      "type": "object",
      "properties": {
        "shipment": {
          "$ref": "#/$defs/Shipment"
        },
        "shipmentState": {
          "$ref": "#/$defs/ShipmentState"
        },
        "orderDate": {
          "$ref": "#/$defs/SimpleDateTime"
        }
      },
      "description": "Contains information about a shipment and its state. The order date contains the time, the shipment was ordered.",
      "required": [
        "shipment",
        "orderDate"
      ]
    },
    "SimpleDate": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
    },
    "SimpleDateTime": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}$",
      "description": "The date time (Central European Time [CET])"
    },
    "State": {
      "type": "string",
      "maxLength": 35
    },
    "TimeFrame": {
      "type": "object",
      "properties": {
        "timeFrom": {
          "type": "string",
          "pattern": "^\\d{2}:\\d{2}$"
        },
        "timeUntil": {
          "type": "string",
          "pattern": "^\\d{2}:\\d{2}$"
        }
      }
    },
    "TransportationType": {
      "type": "string",
      "enum": [
        "PAKET",
        "ROLLBEHAELTER",
        "WECHSELBEHAELTER",
        "PALETTEN",
        "SPERRGUT"
      ],
      "description": "TBD documentation"
    },
    "Weight": {
      "type": "object",
      "properties": {
        "uom": {
          "description": "metric unit for weight",
          "type": "string",
          "enum": [
            "g",
            "kg"
          ],
          "default": "g"
        },
        "value": {
          "type": "number"
        }
      },
      "required": [
        "uom",
        "value"
      ]
    }
  }
}