{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/entur/main/json-schema/entur-version-request-schema.json",
  "title": "VersionRequest",
  "x-generated": "2026-10-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-pricing-api-openapi.yml#/components/schemas/VersionRequest",
  "required": [
    "startDate",
    "status"
  ],
  "type": "object",
  "properties": {
    "status": {
      "allOf": [
        {
          "$ref": "#/$defs/VersionStatus"
        },
        {
          "description": "Must be DRAFT for new versions."
        }
      ]
    },
    "startDate": {
      "type": "string",
      "description": "The start date of the version. Defaults to current date if not provided.",
      "format": "date"
    },
    "endDate": {
      "type": "string",
      "description": "The end date of the version (optional).",
      "format": "date"
    },
    "ownerOrganisationId": {
      "minimum": 1,
      "type": "integer",
      "description": "Internal id of the organisation that owns this element. Omit it to use the organisation in the access token, which is what a caller acting for itself should do. Supplying a different organisation requires permission to act on behalf of that organisation.",
      "format": "int64"
    }
  },
  "$defs": {
    "VersionStatus": {
      "type": "string",
      "enum": [
        "DRAFT",
        "PROPOSED",
        "VERSIONED",
        "DEPRECATED"
      ]
    }
  }
}