{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postnl/json-schema/postnl-pickup-near-coordinates-request-schema.json",
  "title": "PickupNearCoordinatesRequest",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postnl-shipment-api-openapi.yml#/components/schemas/PickupNearCoordinatesRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "coordinates",
    "pickupDate",
    "receiverCountryIso",
    "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
    },
    "coordinates": {
      "description": "Object that contains the reference point marked in coordinates from which locations need to be retrieved",
      "allOf": [
        {
          "$ref": "#/$defs/Coordinate"
        }
      ]
    },
    "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"
    },
    "receiverCountryIso": {
      "type": "string",
      "description": "Restricts the returned locations to the specified country. Country ISO format (ISO 3166-1 alpha-2)",
      "minLength": 2,
      "pattern": "^[A-Z]{2}$"
    },
    "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": {
    "Coordinate": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "latitude",
        "longitude"
      ],
      "properties": {
        "latitude": {
          "type": "number",
          "description": "Latitude of the location",
          "format": "double"
        },
        "longitude": {
          "type": "number",
          "description": "Longitude of the location",
          "format": "double"
        }
      }
    },
    "LocationType": {
      "type": "string",
      "description": "Describes available location types",
      "default": "Retail",
      "x-extensible-enum": [
        "Retail",
        "ParcelLocker"
      ]
    }
  }
}