{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postnl/json-schema/postnl-timeframe-response-schema.json",
  "title": "timeframeResponse",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postnl-timeframes-api-openapi.yml#/components/schemas/timeframeResponse",
  "type": "object",
  "properties": {
    "Timeframes": {
      "type": "object",
      "properties": {
        "Timeframe": {
          "type": "array",
          "description": "A calculated delivery timeframe",
          "items": {
            "type": "object",
            "properties": {
              "Date": {
                "type": "string",
                "description": "The expected date of delivery"
              },
              "Timeframes": {
                "$ref": "#/$defs/timeframesResponseObject"
              }
            }
          }
        }
      }
    },
    "ReasonNoTimeframes": {
      "type": "object",
      "properties": {
        "ReasonNoTimeframe": {
          "type": "array",
          "description": "The reason why no timeframe was returned",
          "items": {
            "type": "object",
            "properties": {
              "Code": {
                "type": "string",
                "description": "The reason code"
              },
              "Date": {
                "type": "string",
                "description": "The date associated with the reason no timeframe was calculated"
              },
              "Description": {
                "type": "string",
                "description": "The description associated with the reason no timeframe was calculated"
              },
              "Options": {
                "$ref": "#/$defs/NoTimeframesOptions"
              },
              "Sustainability": {
                "type": "object",
                "description": "Sustainability score; see [Sustainability codes](https://developer.postnl.nl/docs/#/http/reference-data/reference-codes/sustainability-codes) for possible values.",
                "properties": {
                  "Code": {
                    "type": "string",
                    "description": "Sustainability score code",
                    "enum": [
                      "00",
                      "01",
                      "02",
                      "03"
                    ]
                  },
                  "Description": {
                    "type": "string",
                    "description": "Sustainability score code description"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "$defs": {
    "NoTimeframesOptions": {
      "type": "object",
      "description": "The option for which no timeframe was calculated for a specific date",
      "properties": {
        "string": {
          "type": "string",
          "enum": [
            "Daytime",
            "Today",
            "Sameday",
            "Evening",
            "Morning",
            "Noon",
            "Sunday",
            "Afternoon"
          ]
        }
      }
    },
    "timeframesResponseObject": {
      "type": "object",
      "properties": {
        "TimeframeTimeframe": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "From": {
                "type": "string",
                "description": "The start time of the expected delivery window"
              },
              "Options": {
                "type": "object",
                "description": "The delivery option for which the timeframe is calculated. See [Delivery Options](https://developer.postnl.nl/docs/#/http/reference-data/reference-codes/delivery-options) for possible values.",
                "properties": {
                  "string": {
                    "type": "string",
                    "enum": [
                      "Daytime",
                      "Today",
                      "Sameday",
                      "Evening",
                      "Morning",
                      "Noon",
                      "Sunday",
                      "Afternoon"
                    ]
                  }
                }
              },
              "To": {
                "type": "string",
                "description": "The end time of the expected delivery window"
              },
              "Sustainability": {
                "type": "object",
                "description": "Sustainability score; see [Sustainability codes](https://developer.postnl.nl/docs/#/http/reference-data/reference-codes/sustainability-codes) for possible values.",
                "properties": {
                  "Code": {
                    "type": "string",
                    "description": "Sustainability score code",
                    "enum": [
                      "00",
                      "01",
                      "02",
                      "03"
                    ]
                  },
                  "Description": {
                    "type": "string",
                    "description": "Sustainability score code description"
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}