{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postnl/json-schema/postnl-services-delivery-date-request-schema.json",
  "title": "ServicesDeliveryDateRequest",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postnl-shipment-api-openapi.yml#/components/schemas/ServicesDeliveryDateRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "handoverDate",
    "receiverAddress",
    "customerCode",
    "customerNumber"
  ],
  "properties": {
    "handoverDate": {
      "type": "string",
      "description": "The date on which the user hands over the shipment to PostNL before the cutoff time. Must be today + 1 or a future date. If unsure, use tomorrow's date (today + 1). Format: yyyy-MM-dd (e.g. \"2026-03-10\").",
      "format": "date"
    },
    "receiverAddress": {
      "description": "The address of the receiver",
      "allOf": [
        {
          "$ref": "#/$defs/Address_3"
        }
      ]
    },
    "services": {
      "type": "array",
      "description": "The services that a user can use",
      "items": {
        "$ref": "#/$defs/ServiceType"
      }
    },
    "shipmentType": {
      "description": "Indicates what kind of type a shipment is",
      "allOf": [
        {
          "$ref": "#/$defs/ShipmentType_2"
        }
      ]
    },
    "numberOfDays": {
      "type": "integer",
      "description": "The number of days that is needed to look ahead for the availability of the requested services",
      "format": "int32",
      "default": 1,
      "maximum": 14,
      "minimum": 1
    },
    "customerCode": {
      "type": "string",
      "description": "The unique code to identify the customer",
      "minLength": 1
    },
    "customerNumber": {
      "type": "string",
      "description": "The unique number to identify the customer",
      "minLength": 1
    }
  },
  "$defs": {
    "Address_3": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "countryIso",
        "postalCode"
      ],
      "properties": {
        "countryIso": {
          "type": "string",
          "description": "Country of the recipient (ISO 3166-1 alpha-2)",
          "minLength": 2,
          "pattern": "^(BE|NL)$"
        },
        "postalCode": {
          "type": "string",
          "description": "Postal code of the recipient",
          "maxLength": 17,
          "minLength": 4
        },
        "street": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the street of the recipient",
          "maxLength": 95
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "City of the recipient address",
          "maxLength": 35
        }
      }
    },
    "ServiceType": {
      "type": "string",
      "description": "Describes available service types",
      "default": "daytime",
      "x-extensible-enum": [
        "daytime",
        "evening",
        "guaranteed before 10",
        "guaranteed before 12",
        "guaranteed before 17"
      ]
    },
    "ShipmentType_2": {
      "type": "string",
      "description": "Describes available shipment types",
      "default": "parcel",
      "x-extensible-enum": [
        "parcel"
      ]
    }
  }
}