{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postnl/json-schema/postnl-pickup-near-address-request-schema.json",
  "title": "PickupNearAddressRequest",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postnl-shipment-api-openapi.yml#/components/schemas/PickupNearAddressRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "receiverAddress",
    "pickupDate",
    "customerCode",
    "customerNumber"
  ],
  "properties": {
    "numberOfLocations": {
      "type": "integer",
      "description": "Field that specifies the number of desired locations by the webshops",
      "format": "int32",
      "default": 10,
      "maximum": 10,
      "minimum": 1
    },
    "receiverAddress": {
      "description": "Object, that contains address information that will be used as a reference to retrieve pickup locations",
      "allOf": [
        {
          "$ref": "#/$defs/ReceiverAddress"
        }
      ]
    },
    "locationType": {
      "description": "Field that specifies the type of locations that are desired as pickup possibility; either Retail or ParcelLocker",
      "allOf": [
        {
          "$ref": "#/$defs/LocationType"
        }
      ]
    },
    "pickupDate": {
      "type": "string",
      "description": "Field that specifies the date on which the parcel needs to be delivered at the pickup location. Must be today or a future date. If unsure, use tomorrow's date (today + 1). Format: yyyy-MM-dd (e.g. \"2026-03-10\").",
      "format": "date"
    },
    "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": {
    "LocationType": {
      "type": "string",
      "description": "Describes available location types",
      "default": "Retail",
      "x-extensible-enum": [
        "Retail",
        "ParcelLocker"
      ]
    },
    "ReceiverAddress": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "countryIso",
        "postalCode"
      ],
      "properties": {
        "countryIso": {
          "type": "string",
          "description": "Country of the reference address (ISO 3166-1 alpha-2)",
          "minLength": 2,
          "pattern": "^[A-Z]{2}$"
        },
        "postalCode": {
          "type": "string",
          "description": "Postal code of the reference address",
          "maxLength": 17,
          "minLength": 4
        },
        "street": {
          "type": [
            "string",
            "null"
          ],
          "description": "Name of the street of the reference address",
          "maxLength": 95
        },
        "city": {
          "type": [
            "string",
            "null"
          ],
          "description": "City of the reference address",
          "maxLength": 35
        },
        "houseNumber": {
          "type": [
            "string",
            "null"
          ],
          "description": "House number of the reference address",
          "maxLength": 35
        },
        "houseNumberAddition": {
          "type": [
            "string",
            "null"
          ],
          "description": "Addition to the house number of the reference address",
          "maxLength": 35
        }
      }
    }
  }
}