{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/entur/main/json-schema/entur-reservation-response-v1-schema.json",
  "title": "ReservationResponseV1",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-inventory-openapi.yml#/components/schemas/ReservationResponseV1",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "origin": {
      "type": "string"
    },
    "destination": {
      "type": "string"
    },
    "datedServiceJourney": {
      "type": "string"
    },
    "created": {
      "type": "string",
      "format": "date-time"
    },
    "changed": {
      "type": "string",
      "format": "date-time"
    },
    "createdBy": {
      "type": "string"
    },
    "orderId": {
      "type": "string"
    },
    "reservationLines": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ReservationLineResponseV1"
      }
    }
  },
  "required": [
    "changed",
    "created",
    "createdBy",
    "datedServiceJourney",
    "destination",
    "id",
    "origin",
    "reservationLines"
  ],
  "$defs": {
    "ReservationLineResponseV1": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "format": "int64"
        },
        "productId": {
          "type": "string"
        },
        "amount": {
          "type": "integer",
          "format": "int32"
        },
        "created": {
          "type": "string",
          "format": "date-time"
        },
        "changed": {
          "type": "string",
          "format": "date-time"
        },
        "status": {
          "type": "string",
          "enum": [
            "DRAFT",
            "CONFIRMED",
            "EXPIRED",
            "CANCELLED",
            "DRAFT_CANCELLATION",
            "CONFIRMED_CANCELLATION",
            "RELEASING"
          ]
        }
      },
      "required": [
        "amount",
        "changed",
        "created",
        "id",
        "productId",
        "status"
      ]
    }
  }
}