{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/postnl/json-schema/postnl-checkout-response-schema.json",
  "title": "checkoutResponse",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/postnl-checkout-api-openapi.yml#/components/schemas/checkoutResponse",
  "type": "object",
  "properties": {
    "DeliveryOptions": {
      "type": "array",
      "description": "Array of delivery options",
      "items": {
        "$ref": "#/$defs/checkoutDeliveryOption"
      }
    },
    "PickupOptions": {
      "type": "array",
      "description": "Array of possible pickup options",
      "items": {
        "$ref": "#/$defs/checkoutPickupOption"
      }
    },
    "Warnings": {
      "type": "array",
      "description": "An array of warnings",
      "items": {
        "$ref": "#/$defs/checkoutWarning"
      }
    }
  },
  "$defs": {
    "checkoutDeliveryOption": {
      "type": "object",
      "properties": {
        "DeliveryDate": {
          "type": "string",
          "description": "The possible delivery date"
        },
        "Timeframe": {
          "type": "array",
          "description": "Array of timeframes",
          "items": {
            "$ref": "#/$defs/checkoutTimeFrame"
          }
        }
      }
    },
    "checkoutLocation": {
      "type": "object",
      "properties": {
        "Address": {
          "$ref": "#/$defs/checkoutPickupAddress"
        },
        "PickupTime": {
          "type": "string",
          "description": "Time from when the parcel can be retrieved at the pickup location"
        },
        "OpeningHours": {
          "type": "object",
          "description": "The standard opening hours of the pickup location",
          "properties": {
            "Monday": {
              "$ref": "#/$defs/openingHoursPerDay"
            },
            "Tuesday": {
              "$ref": "#/$defs/openingHoursPerDay"
            },
            "Wednesday": {
              "$ref": "#/$defs/openingHoursPerDay"
            },
            "Thursday": {
              "$ref": "#/$defs/openingHoursPerDay"
            },
            "Friday": {
              "$ref": "#/$defs/openingHoursPerDay"
            },
            "Saturday": {
              "$ref": "#/$defs/openingHoursPerDay"
            },
            "Sunday": {
              "$ref": "#/$defs/openingHoursPerDay"
            }
          }
        },
        "Distance": {
          "type": "integer",
          "description": "The calculated distance (in meters) between the location specified and the address provided in the request"
        },
        "LocationCode": {
          "type": "string",
          "description": "The location identifier"
        },
        "PartnerID": {
          "type": "string",
          "description": "The partner identifier; not used anymore"
        },
        "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"
            }
          }
        }
      }
    },
    "checkoutOption": {
      "type": "string",
      "enum": [
        "Daytime",
        "Evening",
        "Sameday",
        "08:00-10:00",
        "08:00-12:00",
        "08:00-17:00",
        "Pickup"
      ]
    },
    "checkoutPickupAddress": {
      "type": "object",
      "description": "The pickup location address",
      "properties": {
        "Street": {
          "type": "string",
          "description": "The pickup location street"
        },
        "Zipcode": {
          "type": "string",
          "description": "The pickup location zipcode"
        },
        "HouseNr": {
          "type": "integer",
          "description": "The pickup location housenumber"
        },
        "HouseNrExt": {
          "type": "string",
          "description": "The pickup location housenumber extension"
        },
        "Countrycode": {
          "type": "string",
          "description": "The pickup location country"
        },
        "CompanyName": {
          "type": "string",
          "description": "The pickup location company name"
        }
      }
    },
    "checkoutPickupOption": {
      "type": "object",
      "properties": {
        "PickupDate": {
          "type": "string",
          "description": "Date from which the parcel can be picked up at the PostNL location"
        },
        "ShippingDate": {
          "type": "string",
          "description": "The date when you need to deliver the shipment to PostNL to ensure the expected delivery date is achieved. Will be returned as 'null' if not calculated"
        },
        "Option": {
          "type": "string",
          "description": "The pickup option"
        },
        "Locations": {
          "type": "array",
          "description": "Array of pickup locations",
          "items": {
            "$ref": "#/$defs/checkoutLocation"
          }
        }
      }
    },
    "checkoutTimeFrame": {
      "type": "object",
      "properties": {
        "From": {
          "type": "string",
          "description": "Format hh:mm:ss"
        },
        "To": {
          "type": "string",
          "description": "Format hh:mm:ss"
        },
        "Options": {
          "type": "array",
          "description": "The delivery options applicable to the timeframe information. See [Delivery Options](https://developer.postnl.nl/docs/#/http/reference-data/reference-codes/delivery-options) for possible values.",
          "items": {
            "$ref": "#/$defs/checkoutOption"
          }
        },
        "ShippingDate": {
          "type": "string",
          "description": "The date when you need to deliver the shipment to PostNL to ensure the expected delivery date is achieved. Will be returned as 'null' if not calculated"
        },
        "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"
            }
          }
        }
      }
    },
    "checkoutWarning": {
      "type": "object",
      "properties": {
        "DeliveryDate": {
          "type": "string",
          "description": "Deliverydate that triggered the warning"
        },
        "Code": {
          "type": "string",
          "description": "Warning code (for a possible list of warnings, see the generic error codes page)"
        },
        "Description": {
          "type": "string",
          "description": "Warning description (for a possible list of warnings, see the generic error codes page)"
        },
        "Options": {
          "$ref": "#/$defs/checkoutWarningOption"
        }
      }
    },
    "checkoutWarningOption": {
      "type": "string",
      "enum": [
        "Daytime",
        "Evening",
        "Sameday",
        "08:00-10:00",
        "08:00-12:00",
        "08:00-17:00",
        "Pickup"
      ]
    },
    "openingHoursPerDay": {
      "type": "object",
      "properties": {
        "From": {
          "type": "string"
        },
        "To": {
          "type": "string"
        }
      }
    }
  }
}