openapi: 3.1.0
info:
  title: Itinerary
  version: 2.0.0
  description: Schema definition for the Itinerary entity in the Beckn Mobility domain.
  license:
    name: CC-BY-NC-SA 4.0 International
    url: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en
  contact:
    name: Beckn Labs
    url: https://beckn.io
components:
  schemas:
    Itinerary:
      x-iri: https://schema.nfh.global/Itinerary/v2.0
      type: object
      title: Itinerary
      description: A complete planned trip containing an ordered sequence of legs,
        including transfer points, durations, and timing.
      x-tags:
        - mobility
        - schema-org
        - ride-hailing
      properties:
        legs:
          description: Ordered list of legs making up this itinerary
          $ref: https://schema.nfh.global/Leg/v2.0/attributes.yaml#/components/schemas/Leg
        totalDuration:
          description: Total travel duration for the itinerary
          type: string
          format: duration
        totalDistance:
          description: Total distance in metres for the itinerary
          type: number
        transferCount:
          description: Number of transfers in the itinerary
          type: number
        departureTime:
          description: Departure time of the first leg
          type: string
          format: date-time
        arrivalTime:
          description: Arrival time of the last leg
          type: string
          format: date-time
        id:
          description: Unique identifier for the itinerary
          type: string
        descriptor:
          description: Human-readable description of the itinerary
          $ref: https://schema.nfh.global/Descriptor/v2.0/attributes.yaml#/components/schemas/Descriptor
      additionalProperties: false
