{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/emporix/main/json-schema/emporix-slot-creation-schema.json",
  "title": "Slot",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-shipping-openapi.yml#/components/schemas/SlotCreation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Delivery Time Slot ID: Autogenerated (if not provided in request) or User-Defined"
    },
    "shippingMethod": {
      "description": "Selected shipping method which is available for the Delivery Time in the given Time Slot",
      "type": "string"
    },
    "deliveryTimeRange": {
      "$ref": "#/$defs/DeliveryTimeRange"
    },
    "cutOffTime": {
      "$ref": "#/$defs/CutOffTIme"
    },
    "capacity": {
      "type": "integer",
      "description": "A capacity determines how many orders the given Delivery Time Slot can handle"
    }
  },
  "required": [
    "shippingMethod",
    "deliveryTimeRange",
    "cutOffTime",
    "capacity"
  ],
  "$defs": {
    "CutOffTIme": {
      "title": "Cut-Off Time",
      "description": "This denotes the latest point in time by which an action (such as an order or request) must be completed for a specific Delivery Time. This attribute is key in determining the end of a time window for certain operations and helps maintain efficiency in the delivery process.",
      "type": "object",
      "properties": {
        "time": {
          "type": "string",
          "description": "The cut-off time refers to the deadline by which an order must be placed to be eligible for same-day processing and shipping. Date is compliant with the ISO 8601 standard, but only time is taking into account."
        },
        "cutOffDayShift": {
          "type": "integer",
          "minimum": 0,
          "default": 0,
          "description": "Indicates in how many days the order has been delivered when the order has been completed before cut-off time. Property is only available for delivery times of weekday type."
        },
        "deliveryCycleName": {
          "type": "string",
          "description": "An optional suffix that is added to delivery cycle name"
        }
      },
      "required": [
        "time"
      ]
    },
    "DeliveryTimeRange": {
      "title": "Time range",
      "description": "A `from` to `to` time range for which the object is valid",
      "type": "object",
      "properties": {
        "timeFrom": {
          "pattern": "^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$",
          "type": "string",
          "description": "Time from which the object is valid, provided in local time (e.g. 10:00)"
        },
        "timeTo": {
          "pattern": "^(2[0-4]|[01]?[0-9]):([0-5]?[0-9])$",
          "type": "string",
          "description": "Time to which the object is valid, provided in local time (e.g. 10:00)."
        }
      },
      "required": [
        "timeFrom",
        "timeTo"
      ]
    }
  }
}