{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/dpd-group/main/json-schema/dpd-group-pickup-order-schema.json",
  "title": "PickupOrder",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dpd-group-pickup-orders-api-openapi.yml#/components/schemas/PickupOrder",
  "properties": {
    "id": {
      "$ref": "#/$defs/PickupOrderID"
    },
    "specs": {
      "$ref": "#/$defs/PickupOrder_specs"
    },
    "statusCode": {
      "$ref": "#/$defs/StatusCode"
    },
    "statusText": {
      "$ref": "#/$defs/StatusText"
    }
  },
  "required": [
    "id",
    "specs",
    "statusCode",
    "statusText"
  ],
  "$defs": {
    "Address": {
      "properties": {
        "street": {
          "$ref": "#/$defs/Street_1"
        },
        "postalCode": {
          "$ref": "#/$defs/PostalCode"
        },
        "city": {
          "$ref": "#/$defs/City_1"
        },
        "houseNumber": {
          "$ref": "#/$defs/HouseNumber"
        },
        "country": {
          "$ref": "#/$defs/CountryIdent"
        }
      },
      "required": [
        "city",
        "country",
        "postalCode",
        "street"
      ],
      "type": "object"
    },
    "AddressPickupOrderSpecs": {
      "description": "The pickup is ordered to a selected customer address (your address).\n\nThe courier can/will pick up all parcels for which you have printed labels.\n",
      "properties": {
        "customerAddress": {
          "$ref": "#/$defs/CustomerAddressIdent"
        },
        "date": {
          "$ref": "#/$defs/Date"
        },
        "note": {
          "$ref": "#/$defs/CourierNote"
        }
      },
      "required": [
        "customerAddress"
      ],
      "title": "Address"
    },
    "ArbitraryAddressPickupOrderSpecs": {
      "description": "The pickup is ordered to an arbitrary address.\n\nThe courier can/will pick up all parcels for which you have printed labels at the location.\n",
      "properties": {
        "customer": {
          "$ref": "#/$defs/CustomerIdent"
        },
        "arbitraryAddress": {
          "$ref": "#/$defs/ArbitraryAddressPickupOrderSpecs_arbitraryAddress"
        },
        "date": {
          "$ref": "#/$defs/Date"
        },
        "note": {
          "$ref": "#/$defs/CourierNote"
        }
      },
      "required": [
        "arbitraryAddress",
        "customer"
      ],
      "title": "ArbitraryAddress"
    },
    "ArbitraryAddressPickupOrderSpecs_arbitraryAddress": {
      "properties": {
        "info": {
          "$ref": "#/$defs/SubjectInfo"
        },
        "address": {
          "$ref": "#/$defs/Address"
        }
      },
      "required": [
        "address",
        "info"
      ],
      "type": "object"
    },
    "City_1": {
      "description": "WARNING: Depending on type of the label, this field will be shortened to fit the label.\n  - PDF/EPL 31 characters for receiver and 28 characters for sender\n  - ZPL 31 characters for receiver and 19 characters for sender\n",
      "maxLength": 35,
      "type": "string"
    },
    "CollectionPickupOrderResponse": {
      "description": "The created collection pickup order.\n",
      "properties": {
        "parcels": {
          "description": "All parcel numbers from the collection shipment for which the pickup order was created.\n",
          "items": {
            "$ref": "#/$defs/ParcelIdent"
          },
          "type": "array"
        },
        "date": {
          "$ref": "#/$defs/Date"
        },
        "note": {
          "$ref": "#/$defs/CourierNote"
        }
      },
      "required": [
        "parcels"
      ],
      "title": "Collection"
    },
    "CountryAlpha2": {
      "description": "Country ISO Alpha-2 code",
      "maxLength": 2,
      "minLength": 2,
      "type": "string"
    },
    "CountryAlpha3": {
      "description": "Country ISO Alpha-3 code",
      "maxLength": 3,
      "minLength": 3,
      "type": "string"
    },
    "CountryIdent": {
      "oneOf": [
        {
          "$ref": "#/$defs/CountryIdent_oneOf"
        },
        {
          "$ref": "#/$defs/CountryIdent_oneOf_1"
        },
        {
          "$ref": "#/$defs/CountryIdent_oneOf_2"
        }
      ]
    },
    "CountryIdent_oneOf": {
      "properties": {
        "isoAlpha3": {
          "$ref": "#/$defs/CountryAlpha3"
        }
      },
      "required": [
        "isoAlpha3"
      ],
      "type": "object"
    },
    "CountryIdent_oneOf_1": {
      "properties": {
        "isoAlpha2": {
          "$ref": "#/$defs/CountryAlpha2"
        }
      },
      "required": [
        "isoAlpha2"
      ],
      "type": "object"
    },
    "CountryIdent_oneOf_2": {
      "properties": {
        "isoNumeric": {
          "$ref": "#/$defs/CountryNumeric"
        }
      },
      "required": [
        "isoNumeric"
      ],
      "type": "object"
    },
    "CountryNumeric": {
      "description": "Country ISO numeric code",
      "maxLength": 3,
      "minLength": 3,
      "type": "string"
    },
    "CourierNote": {
      "description": "This is a note for the courier.  \nYou can leave some additional information for the courier using this property.\n",
      "maxLength": 200,
      "type": "string"
    },
    "CustomerAddressId": {
      "description": "Internal GeoAPI ID",
      "type": "number"
    },
    "CustomerAddressIdent": {
      "description": "Used to uniquely identify a customer address in the API",
      "oneOf": [
        {
          "$ref": "#/$defs/CustomerAddressIdent_oneOf"
        },
        {
          "$ref": "#/$defs/CustomerAddressIdent_oneOf_1"
        }
      ]
    },
    "CustomerAddressIdent_oneOf": {
      "properties": {
        "id": {
          "$ref": "#/$defs/CustomerAddressId"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "CustomerAddressIdent_oneOf_1": {
      "properties": {
        "it4emId": {
          "$ref": "#/$defs/CustomerAddressIt4emId"
        }
      },
      "required": [
        "it4emId"
      ],
      "type": "object"
    },
    "CustomerAddressIt4emId": {
      "description": "This ID is used DPD wide to uniquely identify a customer address (alternative to GeoAPI specific Customer Address ID)",
      "type": "number"
    },
    "CustomerDSW": {
      "description": "The customer unique global identification number used across multiple DPD services.\n\nA single user account can have multiple customers.  \nThis allows for a single user account to manage multiple branches via this API.\n",
      "maxLength": 12,
      "minLength": 11,
      "type": "string"
    },
    "CustomerID": {
      "description": "The internal GeoAPI customer ID\n\nYou would only use this if there is no other way to identify the customer.\n",
      "type": "number"
    },
    "CustomerIdent": {
      "oneOf": [
        {
          "$ref": "#/$defs/CustomerIdent_oneOf"
        },
        {
          "$ref": "#/$defs/CustomerIdent_oneOf_1"
        }
      ]
    },
    "CustomerIdent_oneOf": {
      "properties": {
        "dsw": {
          "$ref": "#/$defs/CustomerDSW"
        }
      },
      "required": [
        "dsw"
      ],
      "type": "object"
    },
    "CustomerIdent_oneOf_1": {
      "properties": {
        "id": {
          "$ref": "#/$defs/CustomerID"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "Date": {
      "description": "Represented in the YYYY-MM-DD (ISO 8601) format",
      "maxLength": 10,
      "minLength": 10,
      "type": "string"
    },
    "Email": {
      "type": "string"
    },
    "HouseNumber": {
      "type": "string"
    },
    "ParcelId": {
      "description": "The internal GeoAPI parcel ID\n\nYou would only use this if there is no other way to identify the parcel.\n",
      "type": "number"
    },
    "ParcelIdent": {
      "oneOf": [
        {
          "$ref": "#/$defs/ParcelIdent_oneOf"
        },
        {
          "$ref": "#/$defs/ParcelIdent_oneOf_1"
        }
      ]
    },
    "ParcelIdent_oneOf": {
      "properties": {
        "parcelNumber": {
          "$ref": "#/$defs/ParcelNo"
        }
      },
      "required": [
        "parcelNumber"
      ],
      "type": "object"
    },
    "ParcelIdent_oneOf_1": {
      "properties": {
        "id": {
          "$ref": "#/$defs/ParcelId"
        }
      },
      "required": [
        "id"
      ],
      "type": "object"
    },
    "ParcelNo": {
      "description": "Each shipment can have multiple (physical) parcels.  \nThis number is used to identify and reference an individual parcel in the shipment.  \nEach parcel has its own label.\n",
      "maxLength": 14,
      "minLength": 14,
      "type": "string"
    },
    "PhoneNumber": {
      "description": "Can be with or without the international prefix",
      "maxLength": 31,
      "type": "string"
    },
    "PickupOrderID": {
      "description": "This ID is used in the API to uniquely identify a pickup order.\n\nThe user is able to order a pickup for a shipment on one of the customer addresses.  \nDPD will pick the shipment up on the address specified by the user and transfer it to the DPD depot for further processing.  \nThe user is also able to order a regular pickup, in that case the user is usually not using this API to create new shipments.\n",
      "type": "number"
    },
    "PickupOrder_specs": {
      "oneOf": [
        {
          "$ref": "#/$defs/AddressPickupOrderSpecs"
        },
        {
          "$ref": "#/$defs/CollectionPickupOrderResponse"
        },
        {
          "$ref": "#/$defs/ArbitraryAddressPickupOrderSpecs"
        }
      ]
    },
    "PostalCode": {
      "maxLength": 7,
      "minLength": 3,
      "type": "string"
    },
    "StatusCode": {
      "description": "Returns the current state of pickup order.\n- Created is a default state\n",
      "enum": [
        "New",
        "Created",
        "ToCancel",
        "Canceled"
      ],
      "type": "string"
    },
    "StatusText": {
      "description": "Detailed information about the status of the pickup order.\n- `New` = The pickup has been ordered by the customer. We are now waiting for its creation in the DPD systems.\n- `Created` = The pickup order has been created in the DPD systems\n- `ToCancel` = A cancel request for the pickup order has been received and sent for processing\n- `Canceled` = The pickup order has been successfully canceled\n",
      "maxLength": 200,
      "type": "string"
    },
    "Street_1": {
      "description": "Including the descriptive number\n\nWARNING: Depending on type of the label, this field will be shortened to fit the label.\n  - PDF 31 characters for receiver and 28 characters for sender\n  - ZPL/EPL 31 characters for receiver and 19 characters for sender\n",
      "maxLength": 35,
      "type": "string"
    },
    "SubjectInfo": {
      "properties": {
        "name1": {
          "$ref": "#/$defs/SubjectName"
        },
        "name2": {
          "$ref": "#/$defs/SubjectNameSecondary"
        },
        "contact": {
          "$ref": "#/$defs/SubjectInfo_contact"
        }
      },
      "required": [
        "name1"
      ],
      "title": "Subject information",
      "type": "object"
    },
    "SubjectInfo_contact": {
      "properties": {
        "person": {
          "minLength": 2,
          "type": "string"
        },
        "phone": {
          "$ref": "#/$defs/PhoneNumber"
        },
        "email": {
          "$ref": "#/$defs/Email"
        }
      },
      "type": "object"
    },
    "SubjectName": {
      "description": "The name of the sender/receiver.\n\nUsually this is the full name of the receiver/sender.\nYou can also specify the name of the receiving/sending company (e.g) \n\nIt is up to you to specify all required information, for the delivery to be successfully completed.\n\nWARNING: Depending on type of the label, this field will be shortened to fit the label.\n  - PDF/EPL 31 characters for receiver and 28 characters for sender\n  - ZPL 31 characters for receiver and 19 characters for sender\n",
      "maxLength": 35,
      "type": "string"
    },
    "SubjectNameSecondary": {
      "description": "You can use this property if you need to add some additional information about the receiver/sender.\nOr if the information about the receiver/sender are better expressed in separate fields\n\nFor example, you can specify the name of the company here, or the name of the person who is sending/receiving for the shipment.\n\nWARNING: Depending on type of the label, this field will be shortened to fit the label.\n  - PDF/EPL 31 characters for receiver and 28 characters for sender\n  - ZPL 31 characters for receiver and 19 characters for sender\n",
      "maxLength": 35,
      "type": "string"
    }
  }
}