{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postnl/json-schema/postnl-checkout-request-schema.json",
  "title": "checkoutRequest",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postnl-checkout-api-openapi.yml#/components/schemas/checkoutRequest",
  "type": "object",
  "required": [
    "OrderDate",
    "CutOffTimes",
    "Options",
    "Locations",
    "Days",
    "Addresses"
  ],
  "properties": {
    "OrderDate": {
      "type": "string",
      "description": "The order date of the shipment. Format dd-MM-YYYY HH:mm:ss",
      "pattern": "^[0-3]\\d-[0-1]\\d-20\\d{2}\\s[0-2]\\d:[0-5]\\d:[0-5]\\d$"
    },
    "ShippingDuration": {
      "type": "integer",
      "description": "The amount of days it takes for a parcel to be received by PostN. If you delivery the parcel the same day as the order is placed on the webshop, please use the value of 1. A value of 2 means the parcel will arrive at PostNL a day later etc."
    },
    "CutOffTimes": {
      "type": "array",
      "description": "Array of CutOffTimes",
      "items": {
        "$ref": "#/$defs/checkoutCutOffTime"
      }
    },
    "HolidaySorting": {
      "type": "boolean",
      "description": "Specifies whether you are available to ship parcels to PostNL during holidays"
    },
    "Options": {
      "type": "array",
      "description": "Specifies the delivery and pickup options.",
      "items": {
        "$ref": "#/$defs/checkoutOption"
      }
    },
    "Locations": {
      "type": "integer",
      "description": "Specifies the number of locations you want returned. This can be a value of 1-3",
      "minimum": 1,
      "maximum": 3
    },
    "Days": {
      "type": "integer",
      "description": "Specifies the number of days for which the timeframes are returned. This can be a value of 1-9",
      "minimum": 1,
      "maximum": 9
    },
    "Addresses": {
      "type": "array",
      "description": "Array of addresses",
      "items": {
        "$ref": "#/$defs/checkoutAddress"
      }
    }
  },
  "$defs": {
    "checkoutAddress": {
      "type": "object",
      "required": [
        "AddressType",
        "HouseNr",
        "Zipcode",
        "Countrycode"
      ],
      "properties": {
        "AddressType": {
          "type": "string",
          "description": "Address type. 01 is for the receiver address, 02 is for the sender address.",
          "enum": [
            "01",
            "02"
          ]
        },
        "Street": {
          "type": "string",
          "description": "Street name; for Belgian addresses, it is strongly recommended to fill in the  street value",
          "maxLength": 35
        },
        "HouseNr": {
          "type": "integer",
          "description": "The house number of the delivery address"
        },
        "HouseNrExt": {
          "type": "string",
          "description": "House number extension",
          "maxLength": 7
        },
        "Zipcode": {
          "type": "string",
          "description": "Zipcode of the address",
          "minLength": 4,
          "maxLength": 6
        },
        "City": {
          "type": "string",
          "description": "City of the address",
          "maxLength": 35
        },
        "Countrycode": {
          "type": "string",
          "description": "ISO2 country code. Limited to NL and BE.",
          "enum": [
            "NL",
            "BE"
          ]
        }
      }
    },
    "checkoutCutOffDay": {
      "type": "string",
      "description": "The day for which the cutoff time applies. 00 is your default cutoff that applies to all otherwise not specified days, 01 to 07 is Monday to Sunday.",
      "enum": [
        "00",
        "01",
        "02",
        "03",
        "04",
        "05",
        "06",
        "07"
      ]
    },
    "checkoutCutOffTime": {
      "type": "object",
      "required": [
        "Day"
      ],
      "properties": {
        "Day": {
          "$ref": "#/$defs/checkoutCutOffDay"
        },
        "Available": {
          "type": "boolean",
          "description": "Specifies whether you are available to process shipments during the selected day"
        },
        "Type": {
          "$ref": "#/$defs/checkoutCutOffType"
        },
        "Time": {
          "type": "string",
          "description": "Specifies the cutoff time (mandatory when Available is true)",
          "pattern": "^[0-2]\\d:[0-5]\\d:[0-5]\\d$"
        }
      }
    },
    "checkoutCutOffType": {
      "type": "string",
      "description": "Specifies the type belonging to the cutoff time.",
      "enum": [
        "Regular",
        "Sameday",
        "Today"
      ]
    },
    "checkoutOption": {
      "type": "string",
      "enum": [
        "Daytime",
        "Evening",
        "Sameday",
        "08:00-10:00",
        "08:00-12:00",
        "08:00-17:00",
        "Pickup"
      ]
    }
  }
}