{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-order-response-schema.json",
  "title": "OrderResponse",
  "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/OrderResponse",
  "type": "object",
  "properties": {
    "confirmation": {
      "oneOf": [
        {
          "$ref": "#/$defs/OrderPickupResponse"
        },
        {
          "$ref": "#/$defs/ValideOrderResponse"
        }
      ]
    }
  },
  "$defs": {
    "ConfirmedShipment": {
      "type": "object",
      "properties": {
        "transportationType": {
          "$ref": "#/$defs/TransportationType"
        },
        "shipmentNo": {
          "type": "string"
        },
        "orderDate": {
          "$ref": "#/$defs/SimpleDateTime"
        }
      },
      "required": [
        "transportationType",
        "orderDate"
      ]
    },
    "OrderID": {
      "type": "string",
      "minLength": 32,
      "maxLength": 32
    },
    "OrderPickupResponse": {
      "type": "object",
      "properties": {
        "value": {
          "$ref": "#/$defs/PickupConfirmation"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "value",
        "type"
      ]
    },
    "PickupConfirmation": {
      "type": "object",
      "properties": {
        "orderID": {
          "$ref": "#/$defs/OrderID"
        },
        "pickupDate": {
          "$ref": "#/$defs/SimpleDate"
        },
        "freeOfCharge": {
          "type": "boolean"
        },
        "pickupType": {
          "type": "string",
          "enum": [
            "BDA",
            "EZA",
            "EMA"
          ],
          "description": "TBD"
        },
        "confirmedShipments": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ConfirmedShipment"
          }
        }
      },
      "required": [
        "orderID",
        "pickupDate",
        "freeOfCharge",
        "pickupType",
        "confirmedShipments"
      ]
    },
    "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])"
    },
    "TransportationType": {
      "type": "string",
      "enum": [
        "PAKET",
        "ROLLBEHAELTER",
        "WECHSELBEHAELTER",
        "PALETTEN",
        "SPERRGUT"
      ],
      "description": "TBD documentation"
    },
    "ValidationConfirmation": {
      "type": "object",
      "properties": {
        "pickupDate": {
          "$ref": "#/$defs/SimpleDate"
        },
        "freeOfCharge": {
          "type": "boolean"
        },
        "pickupType": {
          "type": "string",
          "enum": [
            "BDA",
            "EZA",
            "EMA"
          ]
        }
      },
      "required": [
        "pickupDate",
        "freeOfCharge",
        "pickupType"
      ]
    },
    "ValideOrderResponse": {
      "type": "object",
      "properties": {
        "value": {
          "$ref": "#/$defs/ValidationConfirmation"
        },
        "type": {
          "type": "string"
        }
      },
      "required": [
        "value",
        "type"
      ]
    }
  }
}