# Synced from feature-foundation's public OpenAPI spec via scripts/sync-openapi.mjs.
# Manually-added endpoints live in content/reference/_supplement.yaml.
# Do not edit this file by hand.
openapi: 3.0.3
info:
  title: HyperTrack API
  version: "1.0"
  description: HyperTrack API Reference — Orders, Workers, Places, Routes, and more.
  contact:
    name: HyperTrack support
    url: https://hypertrack.com/contact
    email: help@hypertrack.com
servers:
  - url: https://v3.api.hypertrack.com
tags:
  - name: Authentication
    description: Obtain and use access tokens for the HyperTrack API.
  - name: Geotags
  - name: Ops Group
  - name: Ops Groups
  - name: Timeline
  - name: Workers
  - name: Orders
  - name: OrderPlans
  - name: Routes
  - name: Tracking
  - name: Visits
  - name: Trip Orders
  - name: Nearby
  - name: OrderTasks
  - name: OrderApprovals
  - name: Approvals
  - name: WorkerApprovers
  - name: Order_Acceptances_Order
  - name: Order_Acceptances_All
  - name: TaskDefinitions
  - name: EstimatedRoutes
  - name: Export
  - name: WorkerExport
  - name: Places
paths:
  /oauth/token:
    post:
      tags:
        - Authentication
      operationId: postOauthToken
      summary: Create access token
      description: >
        Exchange your `client_id` and `client_secret` for a short-lived bearer
        token using the OAuth 2.0 `client_credentials` grant. Send the returned
        `access_token` as `Authorization: Bearer <access_token>` on all API
        requests.
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - grant_type
                - client_id
                - client_secret
              properties:
                grant_type:
                  type: string
                  enum:
                    - client_credentials
                  description: Must be `client_credentials`.
                client_id:
                  type: string
                  description: Your account's client ID.
                client_secret:
                  type: string
                  description: Your account's client secret.
                scope:
                  type: string
                  description: Optional space-delimited list of scopes.
      responses:
        "200":
          description: Token issued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    description: Bearer token to use on subsequent API requests.
                  token_type:
                    type: string
                    example: Bearer
                  expires_in:
                    type: integer
                    description: Token lifetime in seconds.
        "401":
          description: Invalid client credentials.
  /oauth/embed-token:
    post:
      tags:
        - Authentication
      operationId: postOauthEmbedToken
      summary: Secure embed view
      description: >
        Exchange an embeddable view URL for a short-lived secure URL with an
        access token appended, for safely embedding HyperTrack views (such as an
        order view or dashboard) in your own UI. Authenticate with HTTP Basic
        auth using your account ID and secret key.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - embed_url
                - grant_type
              properties:
                embed_url:
                  type: string
                  description: URL to be embedded securely (e.g. an order view or dashboard).
                  example: https://embed.hypertrack.com/orders/my_order_handle?fulfillment-attempt=0&show-visits-only=true
                grant_type:
                  type: string
                  enum:
                    - client_credentials
                  description: Must be `client_credentials`.
      responses:
        "200":
          description: Secure embed URL issued.
          content:
            application/json:
              schema:
                type: object
                properties:
                  access_token:
                    type: string
                    description: The OAuth access token.
                  token_type:
                    type: string
                    example: Bearer
                  expires_in:
                    type: integer
                    description: Token lifetime in seconds.
                  embed_url:
                    type: string
                    description: Original URL to be embedded.
                  secure_embed_url:
                    type: string
                    description: Secure URL with the token appended for embedding.
        "400":
          description: Invalid parameters (missing `embed_url` or invalid `grant_type`).
        "401":
          description: Authentication failed.
        "404":
          description: Order or device not found.
  /orders/:
    get:
      parameters:
        - in: query
          name: worker_handle
          description: Unique customer provided identifier of the worker to used retrieve
            orders associated with the specified worker
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: place_handle
          description: Unique customer provided identifier of the place to be used
            retrieve orders associated with the specified place
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: search_term
          description: String representing the search term. Search will be done on
            order_handle, ops_group_handle, worker_handle and metadata fields.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: ops_group_handle
          description: Unique Handle of Ops Group to fetch orders for
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: order_metadata_filter
          description: JSON encoded string for order metadata to filter orders by
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: risk_status
          description: Filter for risk status of order
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: region_filter
          description: JSON object containing `city`, `state`, or `country` used to filter
            orders
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: status
          description: String representation of Order status to fetch orders for. It can
            be comma separated list, each item in list can be one of
            `completed`, `cancelled`, `rescheduled`, `disabled`, `ongoing`,
            `unplanned`, `assigned`, `planned`. eg.
            `?status=completed,cancelled` or `?status=completed` to filter for
            one status
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: device_id
          description: Filter for orders associated with this device id.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: destination_geohash
          description: Geohash of the area where order destination must lie.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: plan_mode
          description: Mode of planning to be used to filter orders
          schema:
            enum:
              - on_demand
              - scheduled
              - manual
              - pool
            nullable: true
          required: false
        - in: query
          name: plan_id
          description: Filter for orders in this plan id.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: route_handle
          description: Unique Handle of the route to fetch orders for
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: track_mode
          description: Tracking mode to filter orders by. See
            [pre_shift](https://hypertrack.com/docs/shift-tracking#pre-shift-tracking),
            [on_shift](https://hypertrack.com/docs/shift-tracking#on-shift-tracking)
            documentation. `full_shift` includes both pre-shift and on-shift
            tracking. Note that `on_time` and `flex` are deprecated modes.
          schema:
            enum:
              - on_time
              - flex
              - pre_shift
              - on_shift
              - full_shift
            nullable: true
          required: false
        - in: query
          name: device_switch_mode
          description: Device switch mode to filter orders by.
          schema:
            enum:
              - manual
              - login
              - closest_to_destination
            nullable: true
          required: false
        - in: query
          name: created_at_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            created on a given date.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: created_at_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders that created within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: created_at_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that created within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: planned_at_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            planned on a given date.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: planned_at_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders planned within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: planned_at_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders planned within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: scheduled_at_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            scheduled on a given date.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: scheduled_at_date_without_tz
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            scheduled on a given date irrespective of timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: completed_at_date_without_tz
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            completed on a given date irrespective of timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: scheduled_at_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders which have scheduled_at within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: scheduled_at_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that which have scheduled_at within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: scheduled_at_without_tz_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders of that day in all timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: scheduled_at_without_tz_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders of that day in all timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: cancelled_at_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            cancelled on a given date.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: cancelled_at_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders that cancelled within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: cancelled_at_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that cancelled within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: completed_at_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            completed on a given date.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: completed_at_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders that completed within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: completed_at_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that completed within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: rescheduled_marked_at_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            rescheduled on a given date.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: rescheduled_marked_at_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders that rescheduled within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: rescheduled_marked_at_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that rescheduled within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: route_started_at_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders for which
            route started on a given date.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: route_started_at_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders for which route started within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: route_started_at_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders for which route started within a timeframe.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: completed_at_without_tz_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders of that day for all timezone for completed orders.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: completed_at_without_tz_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders of that day for all timezone for completed orders.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: created_at_without_tz_from
          description: Start Date (YYYY-MM-DD ) of the window to retrieve orders from that
            day for all timezone for created orders.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: created_at_without_tz_to
          description: End Date (YYYY-MM-DD ) of the window to retrieve orders till that
            day for all timezone for created orders.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: created_at_date_without_tz
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            created on a given date irrespective of timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: driver_handle
          description: Unique customer provided identifier of the driver to used retrieve
            orders associated with the specified driver
          schema:
            type: string
            nullable: true
            deprecated: true
          required: false
        - in: query
          name: sort_direction
          description: String indicating the preferred sorting type
          schema:
            enum:
              - desc
              - asc
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: Filter for fulfillment attempt number
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: aggregate
          description: Flag to fetch order's aggregated data.
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: limit
          description: Limit to number of results in response
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Encoded value provided by our API to retrieve the next page of orders
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: send_outage
          description: Boolean to send the outage in aggregation
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: tracking_status
          description: Parameter to filter for tracked and untracked orders
          schema:
            type: string
            enum:
              - tracked
              - untracked
            nullable: true
          required: false
        - in: query
          name: filter_outage_category
          description: List of outage category as comma separated strings used for
            filtering associated orders within time range
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: worker_profile_filter
          description: JSON encoded string metadata associated with the worker to filter
            orders
          schema:
            type: string
            nullable: true
            format: Encoded JSON
          required: false
        - in: query
          name: worker_inside_destination
          description: Boolean flag to filter orders based on whether the worker is inside
            the destination or not.
          schema:
            type: boolean
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetOrdersResponse"
              examples:
                Filtered on date, ops_group_handle and status:
                  summary: Filtered on date, ops_group_handle and status
                  value:
                    orders:
                      - order_handle: order-1
                        fulfillment_attempt: 0
                        status: completed
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - -121.9007247
                              - 37.3811932
                          address: 1028 E Brokaw Rd, San Jose, CA 95131
                          radius: 100
                        ops_group_handle: store-SF
                        track_mode: on_time
                        plan_mode: manual
                        scheduled_at: 2023-10-31T04:00:00.000Z
                        type: drop
                        type_index: 0
                        expected_service_time: 0
                        capacity_used: 1
                        metadata:
                          customerID: "12654"
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        product_type:
                          - frozen
                          - fragile
                        completed_at: 2023-10-31T23:13:21.287Z
                        device_id: 52193948-1A79-14GF-AB81-2FB0A59536S3
                        worker_handle: james@ht.com
                        created_at: 2023-10-30T23:41:47.489Z
                        assigned_at: 2023-10-31T23:13:03.712Z
                        route_handle: a3f6e79c-c830-4766-8a3d-9eeaa5099ce2
                Filtered on date, worker and status:
                  summary: Filtered on date, worker and status
                  value:
                    orders:
                      - order_handle: order-1
                        fulfillment_attempt: 0
                        status: completed
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - -121.9007247
                              - 37.3811932
                          address: 1028 E Brokaw Rd, San Jose, CA 95131
                          radius: 100
                        ops_group_handle: store-SF
                        track_mode: on_time
                        plan_mode: manual
                        scheduled_at: 2023-10-31T04:00:00.000Z
                        type: drop
                        type_index: 0
                        expected_service_time: 0
                        capacity_used: 1
                        metadata:
                          customerID: "12654"
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        product_type:
                          - frozen
                          - fragile
                        completed_at: 2023-10-31T23:13:21.287Z
                        device_id: 52193948-1A79-14GF-AB81-2FB0A59536S3
                        worker_handle: james@ht.com
                        created_at: 2023-10-30T23:41:47.489Z
                        assigned_at: 2023-10-31T23:13:03.712Z
                        route_handle: a3f6e79c-c830-4766-8a3d-9eeaa5099ce2
                Filtered on date and status:
                  summary: Filtered on date and status
                  value:
                    orders:
                      - order_handle: order-1
                        fulfillment_attempt: 0
                        status: cancelled
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - -121.8871193
                              - 37.390611
                          address: 1709 Automation Pkwy, San Jose, CA 95101
                          radius: 100
                        ops_group_handle: store-SF
                        track_mode: on_time
                        plan_mode: scheduled
                        scheduled_at: 2023-10-31T02:00:00.000Z
                        type: pick
                        type_index: 0
                        expected_service_time: 0
                        capacity_used: 1
                        metadata:
                          customerID: "12654"
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        product_type:
                          - frozen
                          - fragile
                        cancelled_at: 2023-10-31T23:13:13.926Z
                        device_id: 52393948-1A79-47CC-AB81-2FB0A59536D1
                        worker_handle: james@ht.com
                        created_at: 2023-10-30T23:42:28.655Z
                        assigned_at: 2023-10-31T23:13:03.617Z
                        route_handle: a3f6e79c-c830-4766-8a3d-9eeaa5099ce2
                        plan_id: a7a9c72e-bf31-44f5-8a59-c4fffb5fb9d4
                      - order_handle: order-2
                        fulfillment_attempt: 0
                        status: cancelled
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - -121.8871193
                              - 37.390611
                          address: 1709 Automation Pkwy, San Jose, CA 95101
                          radius: 100
                        ops_group_handle: store-SF
                        track_mode: on_time
                        plan_mode: manual
                        scheduled_at: 2023-10-31T02:00:00.000Z
                        type: pick
                        type_index: 0
                        expected_service_time: 0
                        capacity_used: 1
                        metadata:
                          customerID: "12654"
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        product_type:
                          - frozen
                          - fragile
                        cancelled_at: 2023-10-31T00:13:01.073Z
                        created_at: 2023-10-30T23:41:47.489Z
                        route_handle: afb94d64-2702-4efa-b938-d1facfd7832c
                      - order_handle: order-4
                        fulfillment_attempt: 0
                        status: cancelled
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - -121.8970798
                              - 37.3838274
                          address: 1710 Old Oakland Rd, San Jose, CA 95131
                        ops_group_handle: store-SF
                        track_mode: on_time
                        plan_mode: manual
                        scheduled_after: 2023-10-31T02:00:00.000Z
                        scheduled_at: 2023-10-31T04:00:00.000Z
                        type: drop
                        type_index: 0
                        expected_service_time: 0
                        capacity_used: 1
                        metadata:
                          customerId: "1442"
                          name: Jordan
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        product_type:
                          - frozen
                          - fragile
                          - valuable
                        cancelled_at: 2023-10-31T00:12:56.688Z
                        created_at: 2023-10-30T22:22:54.071Z
                        route_handle: afb94d64-2702-4efa-b938-d1facfd7832c
                Unplanned orders with planning failure reason:
                  summary: Unplanned orders with planning failure reason
                  value:
                    orders:
                      - order_handle: order-5
                        fulfillment_attempt: 0
                        status: unplanned
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - -121.8970798
                              - 37.3838274
                          address: 1710 Old Oakland Rd, San Jose, CA 95131
                          radius: 100
                        ops_group_handle: store-SF
                        plan_mode: scheduled
                        plan_id: a7a9c72e-bf31-44f5-8a59-c4fffb5fb9d4
                        scheduled_after: 2023-10-31T02:00:00.000Z
                        scheduled_at: 2023-10-31T04:00:00.000Z
                        type: drop
                        expected_service_time: 0
                        capacity_used: 1
                        created_at: 2023-10-30T22:22:54.071Z
                        planning_failure_reason: The optimizer dropped this order to satisfy planning
                          constraints for the overall plan.
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Orders
      description: >-
        Get orders with optional query parameters


        ### Planning failure reasons


        When an order is left unplanned by automated planning,
        `planning_failure_reason` may contain one of these values:


        - `No Worker was available for this plan.`

        - `No Worker schedule overlaps with this order's time window.`

        - `This order is outside the available Worker working hours.`

        - `Worker location is unavailable, so travel time could not be
        evaluated.`

        - `Worker start location is unavailable for the configured route start
        setting.`

        - `No Worker supports the required product type for this order.`

        - `Route was being modified concurrently and this order needs to be
        re-planned.`

        - `The optimizer dropped this order to satisfy planning constraints for
        the overall plan.`

        - `The optimizer could not find a feasible plan for the provided
        constraints.`

        - `Travel time calculation failed for this planning attempt.`

        - `Ops group configuration is incomplete for automated planning.`

        - `Assigning this order would exceed route or Worker capacity.`

        - `No Worker can reach this order before scheduled_at.`

        - `Assigning this order would delay an already planned downstream
        order.`

        - `Assigning this order would exceed the Worker's shift end time.`

        - `Automated planning could not assign this order with the provided
        constraints.`
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters: []
      responses:
        "201":
          description: One of OrderListResponse or PlanResponse
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: "#/components/schemas/RouteDetail"
                  - $ref: "#/components/schemas/PlanResponse"
                  - $ref: "#/components/schemas/OrderListResponse"
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "409":
          description: Conflict - Planning request already executing for one of the orders
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Batch and Sequence Orders
      description: Post a sequence of orders to be planned either manually or
        automatically by HyperTrack. For automatic planning, please contact the
        HyperTrack team to get set up.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/BatchOrdersRequest"
            examples:
              Orders for manual planning without worker_handle:
                summary: Create orders for to be planned manually.
                value:
                  plan_mode: manual
                  ops_group_handle: store-SF
                  orders:
                    - order_handle: order-1
                      scheduled_at: 2023-10-31T02:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: pick
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1709 Automation Pkwy, San Jose, CA 95101
                        geometry:
                          type: Point
                          coordinates:
                            - -121.8871193
                            - 37.390611
                        radius: 100
                    - order_handle: order-2
                      scheduled_at: 2023-10-31T04:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: drop
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1028 E Brokaw Rd, San Jose, CA 95131
                        geometry:
                          type: Point
                          coordinates:
                            - -121.9007247
                            - 37.3811932
                        radius: 100
              Orders for manual planning with worker_handle:
                summary: Create orders for to be planned manually when worker handle has been
                  provided.
                value:
                  plan_mode: manual
                  ops_group_handle: store-SF
                  worker_handle: test_driver
                  orders:
                    - order_handle: order-1
                      scheduled_at: 2023-10-31T02:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: pick
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1709 Automation Pkwy, San Jose, CA 95101
                        geometry:
                          type: Point
                          coordinates:
                            - -121.8871193
                            - 37.390611
                        radius: 100
                    - order_handle: order-2
                      scheduled_at: 2023-10-31T04:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: drop
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1028 E Brokaw Rd, San Jose, CA 95131
                        geometry:
                          type: Point
                          coordinates:
                            - -121.9007247
                            - 37.3811932
                        radius: 100
              Orders for on demand planning without worker_handle:
                summary: Create orders for to be planned manually.
                value:
                  plan_mode: on_demand
                  ops_group_handle: store-SF
                  orders:
                    - order_handle: order-1
                      scheduled_at: 2023-10-31T02:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: pick
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1709 Automation Pkwy, San Jose, CA 95101
                        geometry:
                          type: Point
                          coordinates:
                            - -121.8871193
                            - 37.390611
                        radius: 100
                    - order_handle: order-2
                      scheduled_at: 2023-10-31T04:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: drop
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1028 E Brokaw Rd, San Jose, CA 95131
                        geometry:
                          type: Point
                          coordinates:
                            - -121.9007247
                            - 37.3811932
                        radius: 100
              Orders for on demand planning with worker_handle:
                summary: Create orders for to be planned manually when worker handle has been
                  provided.
                value:
                  plan_mode: on_demand
                  ops_group_handle: store-SF
                  worker_handle: test_driver
                  orders:
                    - order_handle: order-1
                      scheduled_at: 2023-10-31T02:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: pick
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1709 Automation Pkwy, San Jose, CA 95101
                        geometry:
                          type: Point
                          coordinates:
                            - -121.8871193
                            - 37.390611
                        radius: 100
                    - order_handle: order-2
                      scheduled_at: 2023-10-31T04:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: drop
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1028 E Brokaw Rd, San Jose, CA 95131
                        geometry:
                          type: Point
                          coordinates:
                            - -121.9007247
                            - 37.3811932
                        radius: 100
              Orders for scheduled planning:
                summary: Create orders scheduled for later that are to be planned automatically.
                value:
                  plan_mode: scheduled
                  ops_group_handle: store-SF
                  orders:
                    - order_handle: order-3
                      scheduled_at: 2023-10-31T02:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: pick
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1709 Automation Pkwy, San Jose, CA 95101
                        geometry:
                          type: Point
                          coordinates:
                            - -121.8871193
                            - 37.390611
                        radius: 100
                    - order_handle: order-4
                      scheduled_at: 2023-10-31T04:00:00.000Z
                      product_type:
                        - frozen
                        - fragile
                      type: drop
                      metadata:
                        customerID: "12654"
                      destination:
                        address: 1028 E Brokaw Rd, San Jose, CA 95131
                        geometry:
                          type: Point
                          coordinates:
                            - -121.9007247
                            - 37.3811932
                        radius: 100
      security:
        - BasicAuth: []
        - TokenAuth: []
  /visits/:
    get:
      parameters:
        - in: query
          name: visit_id
          description: Unique identifier representing each visit.
          schema:
            type: string
            format: uuid
            nullable: true
          required: false
        - in: query
          name: geofence_id
          description: Geofence Id associated with visit
          schema:
            type: string
            format: uuid
            nullable: true
          required: false
        - in: query
          name: driver_handle
          description: String representing the handle for the driver to fetch the required
            visits.
          schema:
            type: string
            nullable: true
            deprecated: true
          required: false
        - in: query
          name: worker_handle
          description: String representing the handle for the worker to fetch the required
            visits.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: device_id
          description: Device Id associated with visit
          schema:
            type: string
            format: uuid
            nullable: true
          required: false
        - in: query
          name: order_handle
          description: String representing the handle for the order to fetch the required
            visits.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: place_handle
          description: String representing the handle for the place to fetch the required
            visits.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Identifier used to fetch the next page of data
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: visited_at_from
          description: ISO 8601 datetime indicating the visit's start time for filtering
          schema:
            type: string
            format: date-time
            nullable: true
          required: false
        - in: query
          name: visited_at_to
          description: ISO 8601 datetime indicating the visit's end time for filtering
          schema:
            type: string
            format: date-time
            nullable: true
          required: false
        - in: query
          name: metadata_filter
          description: JSON encoded string metadata associated with the visits
          schema:
            type: string
            nullable: true
            format: Encoded JSON
          required: false
        - in: query
          name: region_filter
          description: JSON encoded string region associated with the visits
          schema:
            type: string
            nullable: true
            format: Encoded JSON
          required: false
        - in: query
          name: search_term
          description: String representing the search term. Search will be done on
            order_handle, ops_group_handle, driver_handle and metadata fields.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: aggregate
          description: Flag set to retrieve aggregated data over the provided time range
          schema:
            type: boolean
            default: false
          required: false
        - in: query
          name: arrived_at_date_without_tz_from
          description: Start date (YYYY-MM-DD) of the time window used as a filter to
            retrieve orders scheduled on a specific date, regardless of the
            timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: arrived_at_date_without_tz_to
          description: End date (YYYY-MM-DD) of the time window used as a filter to
            retrieve orders scheduled on a specific date, regardless of the
            timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Number of Orders to be sent in response
          schema:
            type: integer
            default: 100
            nullable: true
          required: false
        - in: query
          name: ops_group_handles
          description: List of ops group handles as strings used for fetching associated
            visits
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: attachments
          description: List of attachments in event
          schema:
            type: array
            nullable: true
            minItems: 1
            maxItems: 10
            items:
              oneOf:
                - $ref: "#/components/schemas/ImageAttachment"
                - $ref: "#/components/schemas/NoteAttachment"
                - $ref: "#/components/schemas/SignatureAttachment"
          required: false
          explode: true
          style: form
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetVisitsResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Visits
      summary: Get Visits
      description: Retrieves Visits associated with orders. This API provides the
        ability to filter for visits based on a set of query parameters.
      security:
        - BasicAuth: []
        - TokenAuth: []
  /geotags/:
    get:
      parameters:
        - in: query
          name: order_handle
          description: String represent order identifier to fetch geotags associated with
            the identifier
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: worker_handle
          description: String representing the handle for the worker
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: driver_handle
          description: String representing the handle for the driver
          schema:
            type: string
            nullable: true
            deprecated: true
          required: false
        - in: query
          name: ops_group_handles
          description: List of ops group handles as strings used for fetching associated
            Geotags
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: search_term
          description: String representing the search term. Search will be done on
            order_handle, ops_group_handle, worker_handle and metadata fields.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: device_id
          description: String representing the ID of the device
          schema:
            type: string
            format: uuid
            nullable: true
          required: false
        - in: query
          name: device_name
          description: Name of the worker provided during registration
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: driver_profile_filter
          description: JSON encoded string metadata associated with the worker who
            generated the geotag
          schema:
            type: string
            nullable: true
            format: Encoded JSON
          required: false
        - in: query
          name: metadata_filter
          description: JSON encoded string metadata associated with the geotag
          schema:
            type: string
            nullable: true
            format: Encoded JSON
          required: false
        - in: query
          name: system_generated_order_handle
          description: Boolean to filter out orders where order handle was automatically
            generated by HT system
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: include_system_generated_order_handle
          description: Flag to include orders where order handle was automatically
            generated by HT system.
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: region
          description: JSON encoded string for region
          schema:
            type: string
            nullable: true
            format: Encoded JSON
          required: false
        - in: query
          name: pagination_token
          description: Identifier used to fetch the next page of data
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: from_time
          description: ISO 8601 datetime indicating the start time
          schema:
            type: string
            format: date-time
            nullable: true
          required: false
        - in: query
          name: to_time
          description: ISO 8601 datetime indicating the end time
          schema:
            type: string
            format: date-time
            nullable: true
          required: false
        - in: query
          name: from_date
          description: Start date (YYYY-MM-DD) of the time window used as a filter to
            retrieve geotags scheduled on a specific date, regardless of the
            timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: to_date
          description: End date (YYYY-MM-DD) of the time window used as a filter to
            retrieve geotags scheduled on a specific date, regardless of the
            timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: from_geotag_type
          description: String representing type of geotag which corresponds to start of
            time segment within the order fulfilled through geotags
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: to_geotag_type
          description: String representing type of geotag which corresponds to end of time
            segment within the order fulfilled through geotags
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: fetch_attachment_links
          description: Flag to return attachment links as part of response
          schema:
            type: boolean
            default: false
          required: false
        - in: query
          name: include_geotags_with_orders
          description: Flag to filter geotags which are part of order.
          schema:
            type: boolean
            default: false
            nullable: true
          required: false
        - in: query
          name: aggregate
          description: Flag set to retrieve aggregated data over the provided time range
          schema:
            type: boolean
            default: false
          required: false
        - in: query
          name: limit
          description: Number of Orders to be sent in response
          schema:
            type: integer
            default: 100
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetGeotagsResponse"
              examples:
                list_example:
                  summary: Get Orders List Fulfilled Using Geotags
                  value:
                    orders:
                      - order_handle: order-1
                        ops_group_handle: store-san-jose
                        system_generated_order_handle: false
                        device_id: 00112233-4455-6677-8899-AABBCCDDEEFF
                        worker_handle: james_smith
                        driver_name: James Smith
                        last_geotag_recorded_at: 2023-04-19T14:00:58Z
                        distance: 6529
                        duration: 10830
                        tracking_rate: 0.64
                        geotags:
                          - geotag_id: befe814d-79e5-44d5-ac03-c4e47e0931c9
                            order_handle: order-1
                            geotag_type: PICKUP
                            ops_group_handle: store-san-jose
                            system_generated_order_handle: false
                            recorded_at: 2023-04-19T14:00:58Z
                            device_id: 00112233-4455-6677-8899-AABBCCDDEEFF
                            worker_handle: james_smith
                            driver_name: James Smith
                            distance: 1729
                            duration: 8230
                            tracking_rate: 0.84
                            metadata:
                              regionId: 12234
                              zoneId: 3
                            location:
                              geometry:
                                type: Point
                                coordinates:
                                  - -122.4285939
                                  - 37.7598248
                              address: Dolores St &, 19th St, San Francisco, CA 94114
                            expected_location:
                              geometry:
                                type: Point
                                coordinates:
                                  - -122.4297458
                                  - 37.7617545
                              address: 3750 18th St, San Francisco, CA 94114
                            summary:
                              distance: 2300
                              duration: 1200
                              tracking_rate: 86.5
                              deviation: 500
                            start_location:
                              geometry:
                                type: Point
                                coordinates:
                                  - -122.4526714
                                  - 37.7652444
                              address: 941 Cole St, San Francisco, CA 94117
                            region:
                              city: San Francisco
                              state: California
                              country: United States of America
                          - geotag_id: f92s813d-5f33-8ks2-9j32-c8f44d59432b1
                            order_handle: order-1
                            geotag_type: ARRIVED
                            ops_group_handle: store-san-jose
                            system_generated_order_handle: false
                            recorded_at: 2023-04-19T14:30:58Z
                            device_id: 00112233-4455-6677-8899-AABBCCDDEEFF
                            worker_handle: james_smith
                            driver_name: James Smith
                            distance: 1800
                            duration: 2000
                            tracking_rate: 0.89
                            metadata:
                              regionId: 12234
                              zoneId: 3
                            location:
                              geometry:
                                type: Point
                                coordinates:
                                  - -122.419329
                                  - 37.752945
                              address: 2756 Mission St, San Francisco, CA 94110
                            expected_location:
                              geometry:
                                type: Point
                                coordinates:
                                  - -122.4214724
                                  - 37.7530874
                              address: 2740 Mission St, San Francisco, CA 94110
                            summary:
                              distance: 100
                              duration: 600
                              tracking_rate: 99.5
                              deviation: 100
                            start_location:
                              geometry:
                                type: Point
                                coordinates:
                                  - -122.4526714
                                  - 37.7652444
                              address: 941 Cole St, San Francisco, CA 94117
                            region:
                              city: San Francisco
                              state: California
                              country: United States of America
                          - geotag_id: ctfe813d-87v3-46d3-fd90-c8f44d59432b3
                            order_handle: order-1
                            geotag_type: COMPLETED
                            ops_group_handle: store-san-jose
                            system_generated_order_handle: false
                            recorded_at: 2023-04-19T14:30:58Z
                            device_id: 00112233-4455-6677-8899-AABBCCDDEEFF
                            worker_handle: james_smith
                            driver_name: James Smith
                            distance: 1800
                            duration: 2000
                            tracking_rate: 0.91
                            metadata:
                              regionId: 12234
                              zoneId: 3
                            location:
                              geometry:
                                type: Point
                                coordinates:
                                  - -122.4214724
                                  - 37.7530874
                              address: 2740 Mission St, San Francisco, CA 94110
                            expected_location:
                              geometry:
                                type: Point
                                coordinates:
                                  - -122.4214724
                                  - 37.7530874
                              address: 2740 Mission St, San Francisco, CA 94110
                            summary:
                              distance: 2300
                              duration: 1200
                              tracking_rate: 86.5
                              deviation: 0
                            start_location:
                              geometry:
                                type: Point
                                coordinates:
                                  - -122.4526714
                                  - 37.7652444
                              address: 941 Cole St, San Francisco, CA 94117
                            region:
                              city: San Francisco
                              state: California
                              country: United States of America
                    pagination_token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWQiOiIxMDAiLCJwYWdpdGFudElkIjoiMTAwMDEiLCJhbWF6b25JZCI6IjEwMDAxIn0.9SEKO_8dk00Up2khdGkkgDl6OQg1uYUsbRMaj7TWl-4
                aggregate_example:
                  summary: Get Aggregates for Orders Fulfilled via Geotags
                  value:
                    aggregate:
                      count: 150
                      distance:
                        sum: 98000
                        mean: 654
                        min: 2000
                        max: 15000
                        stdev: 0.6
                        mean_by_driver: 2800
                      duration:
                        sum: 180000
                        mean: 1250
                        min: 600
                        max: 3600
                        stdev: 0.8
                        mean_by_driver: 800
                      geotags:
                        count: 450
                        count_mean: 3
                      tracking_rate: 98.4
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Geotags
      summary: Get Geotags
      description: Retrieves Geotags associated with orders. This API provides the
        ability to filter for Geotags based on a set of query parameters.
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/:
    get:
      parameters:
        - in: query
          name: from_date
          description: "ISO 8601 date format ('yyyy-MM-dd') indicating the start date to
            be used for the summary computation.<br>Default: Current date in
            UTC."
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: to_date
          description: "ISO 8601 date format ('yyyy-MM-dd') indicating the end date to be
            used for the summary computation.<br>Default: Current date in UTC."
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Number of workers to be sent in response
          schema:
            type: integer
            default: 25
            nullable: true
          required: false
        - in: query
          name: include_schedule
          description: Flag to include worker's schedule in the response.
          schema:
            type: boolean
            default: true
          required: false
        - in: query
          name: include_summary
          description: Flag to include worker's summary stats in the response.
          schema:
            type: boolean
            default: true
          required: false
        - in: query
          name: ops_group_handle
          description: List of ops group handles as comma separated strings used to filter
            workers.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: profile
          description: Profile filter to be applied on the list of workers
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: worker_handle
          description: List of worker handles as comma separated strings used for fetching
            associated workers
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: search_term
          description: Keyword to match against worker handle, name, or profile
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Identifier used to fetch the next page of data
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: device_id
          description: Unique identifier for a worker's device. This field is present in
            case the worker is currently linked with a device
          schema:
            type: string
            format: uuid
            nullable: true
          required: false
        - in: query
          name: include_deleted
          description: Flag to include deleted workers
          schema:
            type: boolean
            default: false
          required: false
        - in: query
          name: from_time
          description: ISO 8601 datetime indicating the start time to be used for
            computing summary, status.
          schema:
            type: string
            format: date-time
            nullable: true
            deprecated: true
          required: false
        - in: query
          name: to_time
          description: ISO 8601 datetime indicating the end time to be used for computing
            summary, status.
          schema:
            type: string
            format: date-time
            nullable: true
            deprecated: true
          required: false
        - in: query
          name: filter_outage
          description: Filter workers on a particular outage code.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: filter_outage_category
          description: "List of comma separated outage categories to be used for filtering
            workers. Valid categories:
            `behavioural`,`adversarial`,`reachability`,`os`,`sporadic`"
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: filter_geofence_metadata
          description: geofence_metadata filter for aggregate response
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: aggregate
          description: Flag set to retrieve aggregated data over the provided time range
          schema:
            type: boolean
            default: false
          required: false
        - in: query
          name: work_status
          description: URL-encoded json string specifying filters on availability or
            tracking.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: filter_status
          description: Only list workers that are currently active/inactive/disconnected.
          schema:
            type: string
            enum:
              - active
              - inactive
              - disconnected
            nullable: true
          required: false
        - in: query
          name: tracked
          description: If set to true, only shows workers that were actually tracked
            during the specified period.
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: worked
          description: If set to true, only shows workers that actually during the
            specified period.
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: intended_to_track
          description: If set to true, only shows workers that was supposed to be tracked
            during the specified period.
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: include_lp
          description: Flag to include location permission stats in response (only
            applicable when `aggregate=True`).
          schema:
            type: boolean
            default: false
            nullable: true
          required: false
        - in: query
          name: region_filter
          description: URL-encoded JSON string used to filter workers from a particular
            region. Ex `{"city":"Detroit"}`
          schema:
            type: string
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetWorkersResponse"
              examples:
                Filter on profile:
                  summary: Filter on profile
                  value:
                    workers:
                      - created_at: 2023-10-18T12:41:59.865Z
                        device_id: 7B252163-BC27-46B2-8BFD-FFB87D633602
                        device_info:
                          device_brand: OnePlus
                          device_model: DN2111
                          network_operator: JIO 4G
                          os_hardware_identifier: 10b653a2c0a09e77
                          os_name: Android
                          os_version: "11"
                          sdk_version: 7.0.9+a5a509f3
                          timezone: Asia/Kolkata
                        device_status:
                          data:
                            activity: drive
                            recorded_at: 2023-10-24T16:27:52.768Z
                          value: active
                        devices:
                          - device_id: 7B252163-BC27-46B2-8BFD-FFB87D633602
                            start_time: 2023-10-183T20:42:38Z
                          - device_id: 7B252163-BC27-46B2-8BFD-FFB87D633602
                            start_time: 2023-10-183T16:02:38Z
                            end_time: 2023-10-183T20:41:38Z
                        worker_handle: james@ht.com
                        location:
                          accuracy: 19.35
                          bearing: 352.97
                          geometry:
                            coordinates:
                              - -121.94186
                              - 37.3570492
                              - -44.01
                            type: Point
                          speed: 20.2
                        name: James
                        ops_group_handle: store-sf
                        product_types:
                          - plumbing
                          - hardware
                        profile:
                          zoneId: "4"
                        schedule:
                          - day_of_week: MONDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: TUESDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: WEDNESDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: THURSDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: FRIDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: SATURDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: SUNDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                        home:
                          address: 777 Story Rd, San Jose, CA 95122
                          geometry:
                            type: Point
                            coordinates:
                              - -121.8624398
                              - 37.3304521
                          radius: 100
                        work_status:
                          available: false
                          tracking: true
                        location_permission:
                          recorded_at: 2023-12-19T12:29:54.321Z
                          state: always
                        unavailable_on:
                          - 2023-12-15
                        summary:
                          orders:
                            completed: 4
                            cancelled: 1
                            assigned: 0
                            tracked: 5
                            total: 6
                          geotags: 4
                          visits: 4
                          distance: null
                          duration: null
                          tracking_rate: null
                      - created_at: 2023-10-06T12:00:45.221Z
                        device_id: 71284FFE-D949-4FF7-B238-44C667BE8EF4
                        device_status:
                          data:
                            recorded_at: 2023-10-24T12:51:25.995Z
                          value: disconnected
                        worker_handle: smith@ht.com
                        location:
                          accuracy: 35
                          bearing: 280.3
                          geometry:
                            coordinates:
                              - 20.016091
                              - 50.103046
                              - 250.59
                            type: Point
                          speed: 0
                        name: fero
                        ops_group_handle: store-sjc
                        profile:
                          zoneId: "4"
                        work_status:
                          available: false
                          tracking: true
                      - created_at: 2023-07-13T15:05:31.341Z
                        worker_handle: rick@ht.com
                        ops_group_handle: store-okl
                        profile:
                          zoneId: "4"
                        schedule:
                          - day_of_week: MONDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: TUESDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: WEDNESDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: THURSDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: FRIDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: SATURDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: SUNDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                        work_status:
                          available: false
                          tracking: false
                    pagination_token: eyJwYWdlX251bWJlciI6IDIzLCJsYXN0X2l0ZW1faWQiOiAxMjM0NQ==
                Filter on ops group:
                  summary: Filter on ops group
                  value:
                    workers:
                      - created_at: 2023-07-13T15:05:31.341Z
                        worker_handle: rick@ht.com
                        ops_group_handle: store-okl
                        profile:
                          zoneId: "4"
                        schedule:
                          - day_of_week: MONDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: TUESDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: WEDNESDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: THURSDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: FRIDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: SATURDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                          - day_of_week: SUNDAY
                            end_time: 18:00
                            ops_group_handle: store-sf
                            priority: null
                            start_time: 09:00
                        work_status:
                          available: false
                          tracking: false
                    pagination_token: eyJwYWdlX251bWJlciI6IDIzLCJsYXN0X2l0ZW1faWQiOiAxMjM0NQ==
                Filter on worker handle:
                  summary: Filter on worker handle
                  value:
                    workers:
                      - created_at: 2023-10-18T12:41:59.865Z
                        device_id: 7B252163-BC27-46B2-8BFD-FFB87D633602
                        device_status:
                          data:
                            activity: drive
                            recorded_at: 2023-10-24T16:27:52.768Z
                          value: active
                        worker_handle: james@ht.com
                        location:
                          accuracy: 19.35
                          bearing: 352.97
                          geometry:
                            coordinates:
                              - -121.94186
                              - 37.3570492
                              - -44.01
                            type: Point
                          speed: 20.2
                        name: James
                        ops_group_handle: store-sf
                        profile:
                          zoneId: "4"
                        work_status:
                          available: false
                          tracking: true
                Filter on work status:
                  summary: Filter on work status
                  value:
                    workers:
                      - created_at: 2023-10-18T12:41:59.865Z
                        device_id: 7B252163-BC27-46B2-8BFD-FFB87D633602
                        device_status:
                          data:
                            activity: drive
                            recorded_at: 2023-10-24T16:27:52.768Z
                          value: active
                        worker_handle: james@ht.com
                        location:
                          accuracy: 19.35
                          bearing: 352.97
                          geometry:
                            coordinates:
                              - -121.94186
                              - 37.3570492
                              - -44.01
                            type: Point
                          speed: 20.2
                        name: James
                        ops_group_handle: store-sf
                        profile:
                          zoneId: "4"
                        work_status:
                          available: true
                          tracking: false
                      - created_at: 2023-10-06T12:00:45.221Z
                        device_id: 71284FFE-D949-4FF7-B238-44C667BE8EF4
                        device_status:
                          data:
                            recorded_at: 2023-10-24T12:51:25.995Z
                          value: disconnected
                        worker_handle: smith@ht.com
                        location:
                          accuracy: 35
                          bearing: 280.3
                          geometry:
                            coordinates:
                              - 20.016091
                              - 50.103046
                              - 250.59
                            type: Point
                          speed: 0
                        name: fero
                        ops_group_handle: store-sjc
                        profile:
                          zoneId: "4"
                        work_status:
                          available: true
                          tracking: false
                    pagination_token: eyJwYWdlX251bWJlciI6IDIzLCJsYXN0X2l0ZW1faWQiOiAxMjM0NQ==
                Fetch aggregate:
                  summary: Fetch aggregate
                  value:
                    aggregate:
                      geotags:
                        count: 107
                        deviation: 2300
                        distance: 8035
                        duration: 14583
                      orders:
                        count:
                          assigned: 22
                          cancelled: 516
                          completed: 634
                          ongoing: 8
                          total: 1261
                        deviation: 365
                        distance: 8035
                        duration: 18374
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Get Workers
      description: Fetch workers in a paginated list
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PostWorkerResponse"
              example:
                worker_handle: james@ht.com
                ops_group_handle: store-sf
                product_types:
                  - plumbing
                  - hardware
                device_id: 00000000-4636-461C-B5F6-7E4BEFC09575
                profile:
                  workerId: "0012244"
                  vehicle: Ford F-150
                  zoneId: "4"
                status:
                  available: false
                  working: false
                schedule:
                  - start_time: 09:00
                    end_time: 18:00
                    day_of_week: MONDAY
                  - start_time: 09:00
                    end_time: 18:00
                    day_of_week: TUESDAY
                  - start_time: 09:00
                    end_time: 18:00
                    day_of_week: WEDNESDAY
                  - start_time: 09:00
                    end_time: 18:00
                    day_of_week: THURSDAY
                  - start_time: 09:00
                    end_time: 18:00
                    day_of_week: FRIDAY
                created_at: 2023-06-01T02:00:00Z
                home:
                  address: 777 Story Rd, San Jose, CA 95122
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8624398
                      - 37.3304521
                  radius: 100
                device_status:
                  value: unavailable
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Create Worker
      description: Create a worker
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PostWorkerRequest"
            example:
              worker_handle: james@ht.com
              ops_group_handle: store-sf
              product_types:
                - plumbing
                - hardware
              device_id: 00000000-4636-461C-B5F6-7E4BEFC09575
              profile:
                workerId: "0012244"
                vehicle: Ford F-150
                zoneId: "4"
              schedule:
                - start_time: 09:00
                  end_time: 18:00
                  day_of_week: MONDAY
                - start_time: 09:00
                  end_time: 18:00
                  day_of_week: TUESDAY
                - start_time: 09:00
                  end_time: 18:00
                  day_of_week: WEDNESDAY
                - start_time: 09:00
                  end_time: 18:00
                  day_of_week: THURSDAY
                - start_time: 09:00
                  end_time: 18:00
                  day_of_week: FRIDAY
              home:
                address: 777 Story Rd, San Jose, CA 95122
                geometry:
                  type: Point
                  coordinates:
                    - -121.8624398
                    - 37.3304521
                radius: 100
      security:
        - BasicAuth: []
        - TokenAuth: []
  /nearby/v4:
    get:
      parameters:
        - in: query
          name: pagination_token
          description: Identifier used to fetch the next page of data
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: request_id
          description: Unique id of a nearby search request.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: search_type
          description: Type of nearby search. 'eta' for finding estimates of nearby
            workers, 'region' for finding nearby workers.
          schema:
            type: string
            enum:
              - eta
              - region
            nullable: true
          required: false
        - in: query
          name: order_handle
          description: Order handle used to search nearby workers for. This can later be
            used for tracking and associate nearby requests with corresponding
            orders.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: place_handle
          description: Place handle used to search nearby workers for. This can later be
            used for tracking and associate nearby requests with corresponding
            places.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: from_date
          description: "Start date of the search in yyyy-mm-dd format. default: 3 days ago
            utc date"
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: to_date
          description: "End date of the search in yyyy-mm-dd format. default: todays utc
            date"
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Maximum number of items to return. If not provided, it will default
            to 100.
          schema:
            type: integer
            default: 100
            nullable: true
            maximum: 100
          required: false
        - in: query
          name: aggregate
          description: If true, the response will be aggregated by date and search type.
            If false, the response will be returned as is.
          schema:
            type: boolean
            default: false
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NearbySearchListResponse"
              examples:
                nearby_workers_response_example:
                  summary: Nearby API request response example. This is the list of workers which
                    are ranked based on their distance from the location of
                    interest (nearest first).
                  value:
                    drivers:
                      - device:
                          device_id: 00112233-2F48-4DA1-ACEA-8A8D530670CF
                          info:
                            timezone: America/Los Angeles
                            os_name: iOS
                            device_brand: Apple
                            sdk_version: func test app
                            device_model: IPhone X
                            network_operator: T-Mobile
                            name: Func Test Device
                            os_version: 12.1.4
                            os_hardware_identifier: 719bef31-e487-46e0-86f1-5f32589fd9eb
                          profile:
                            gig_type: ridesharing
                          status:
                            value: active
                            data:
                              activity: drive
                              recorded_at: 2022-06-30T13:35:14.806Z
                        location:
                          coordinates:
                            - -122.3999933082254
                            - 37.793651385106074
                          type: Point
                        duration: null
                        distance: 9303
                        ongoing_trip: null
                        error: null
                    summary:
                      total_drivers: 1
                      processed_drivers: 1
                      unprocessed_drivers: 0
                      outside_region_drivers: 0
                      no_route_drivers: 0
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Nearby
      summary: Get all nearby searches performed
      description: This API returns a list of all nearby searches performed. The
        response includes the search parameters, the results of the search. The
        API is useful for tracking the history of nearby searches and for
        debugging purposes. The API returns a paginated list of nearby searches,
        with the ability to filter by date range and search parameters.
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NearbyResponse"
              examples:
                nearby_workers_response_example:
                  summary: Nearby API request response example. This is the list of workers which
                    are ranked based on their distance from the location of
                    interest (nearest first).
                  value:
                    request_id: 00000000-aaaa-bbbb-cccc-111122223333
                    summary:
                      no_route_workers: 0
                      outside_region_workers: 0
                      processed_workers: 2
                      total_workers: 2
                      unprocessed_workers: 0
                    workers:
                      - created_at: 2024-10-10 10:10:10.000000
                        device:
                          device_id: AAA11111-BBBB-2222-CCCC-3333DDDD4444
                          info:
                            device_brand: Apple
                            device_model: iPad9,3
                            name: worker001
                            network_operator: CarrierX
                            os_name: iOS
                            os_version: 16.3.0
                            sdk_version: 5.11.0+abcd1234
                            timezone: America/Chicago
                          profile:
                            driver_handle: worker001
                          status:
                            data:
                              activity: idle
                              recorded_at: 2025-05-16T08:00:00.000Z
                            value: active
                        distance: 8276.293463598915
                        location:
                          coordinates:
                            - -89.079472
                            - 42.264265
                          type: Point
                        name: worker001
                        ops_group_handle: default
                        profile:
                          driver_handle: worker001
                        timezone: America/Chicago
                        work_status:
                          available: true
                          tracking: true
                        worker_handle: worker001
                      - created_at: 2025-01-15 14:30:00.000000
                        device:
                          device_id: BBB22222-CCCC-3333-DDDD-4444EEEE5555
                          info:
                            device_brand: Apple
                            device_model: iPhone13,2
                            name: worker002
                            network_operator: CarrierY
                            os_name: iOS
                            os_version: 17.0.1
                            sdk_version: 5.11.0+abcd1234
                            timezone: America/Chicago
                          profile:
                            driver_handle: worker002
                          status:
                            data:
                              reason: manual_shutdown
                              recorded_at: 2025-05-16T08:15:00.000Z
                            value: inactive
                        distance: 8373.143574586262
                        location:
                          coordinates:
                            - -89.080647
                            - 42.264208
                          type: Point
                        name: worker002
                        ops_group_handle: default
                        profile:
                          driver_handle: worker002
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: false
                        worker_handle: worker002
                filtered_nearby_workers_response_example:
                  summary: Nearby API request response example filtered by profile/search
                    criteria. This is the list of workers which are ranked based
                    on their distance from the location of interest (nearest
                    first) and matching the specified criteria.
                  value:
                    request_id: 00000000-aaaa-bbbb-cccc-111122223344
                    summary:
                      no_route_workers: 0
                      outside_region_workers: 0
                      processed_workers: 1
                      total_workers: 1
                      unprocessed_workers: 0
                    workers:
                      - created_at: 2024-10-10 10:10:10.000000
                        device:
                          device_id: AAA11111-BBBB-2222-CCCC-3333DDDD4444
                          info:
                            device_brand: Apple
                            device_model: iPad9,3
                            name: worker001
                            network_operator: CarrierX
                            os_name: iOS
                            os_version: 16.3.0
                            sdk_version: 5.11.0+abcd1234
                            timezone: America/Chicago
                          profile:
                            driver_handle: worker001
                          status:
                            data:
                              activity: idle
                              recorded_at: 2025-05-16T08:00:00.000Z
                            value: active
                        distance: 8276.293463598915
                        location:
                          coordinates:
                            - -89.079472
                            - 42.264265
                          type: Point
                        name: worker001
                        ops_group_handle: default
                        profile:
                          driver_handle: worker001
                        timezone: America/Chicago
                        work_status:
                          available: true
                          tracking: true
                        worker_handle: worker001
                eta_workers_response_example:
                  summary: Nearby API request response example for getting ETA of a list of
                    workers. This is the list of workers which are ranked based
                    on their drive duration from the location of interest
                    (nearest first).
                  value:
                    request_id: 9b47006e-34de-450d-8681-50fa2c519a79
                    summary:
                      no_route_workers: 0
                      outside_region_workers: 0
                      processed_workers: 2
                      total_workers: 2
                      unprocessed_workers: 0
                    workers:
                      - created_at: 2024-07-09 20:10:10.442000
                        device:
                          device_id: DEVICE-001
                          info:
                            device_brand: Apple
                            device_model: iPhone15,4
                            name: worker_alpha
                            network_operator: --
                            os_name: iOS
                            os_version: 18.4.1
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: worker_alpha
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T08:30:45.224Z
                            value: active
                        distance: 2696
                        duration: 236
                        location:
                          coordinates:
                            - -88.997979
                            - 42.262501
                          type: Point
                        name: worker_alpha
                        ops_group_handle: default
                        profile:
                          driver_handle: worker_alpha
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: worker_alpha
                      - created_at: 2024-07-09 18:52:01.346000
                        device:
                          device_id: DEVICE-002
                          info:
                            device_brand: samsung
                            device_model: SM-S908U1
                            name: worker_bravo
                            network_operator: AT&T
                            os_name: Android
                            os_version: "14"
                            sdk_version: 7.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: worker_bravo
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T08:39:29.562Z
                            value: active
                        distance: 120822
                        duration: 4530
                        location:
                          coordinates:
                            - -87.682951
                            - 41.994821
                          type: Point
                        name: worker_bravo
                        ops_group_handle: default
                        profile:
                          driver_handle: worker_bravo
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: worker_bravo
                eta_nearby_workers_response_example:
                  summary: Nearby API request response example for getting ETA of nearby workers.
                    This is the list of workers which are ranked based on their
                    drive duration from the location of interest (nearest
                    first).
                  value:
                    request_id: b8aeafa1-4024-4e3e-957d-9e77f113ec27
                    summary:
                      no_route_workers: 0
                      outside_region_workers: 0
                      processed_workers: 8
                      total_workers: 10
                      unprocessed_workers: 2
                    workers:
                      - created_at: 2024-07-09 20:10:10.442000
                        device:
                          device_id: UPDATED-DEVICE-ID-0
                          info:
                            device_brand: Apple
                            device_model: iPhone15,4
                            name: updated_name_0
                            network_operator: --
                            os_name: iOS
                            os_version: 18.4.1
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: updated_driver_handle_0
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T07:07:17.222Z
                            value: active
                        distance: 2696
                        duration: 292
                        location:
                          coordinates:
                            - -88.998123
                            - 42.262075
                          type: Point
                        name: updated_name_0
                        ops_group_handle: default
                        profile:
                          driver_handle: updated_driver_handle_0
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: updated_worker_handle_0
                      - created_at: 2024-11-29 17:25:37.284000
                        device:
                          device_id: UPDATED-DEVICE-ID-1
                          info:
                            device_brand: Apple
                            device_model: iPad7,12
                            name: updated_name_1
                            network_operator: --
                            os_name: iOS
                            os_version: 17.5.1
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: updated_driver_handle_1
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T07:37:54.821Z
                            value: active
                        distance: 9171
                        duration: 720
                        location:
                          coordinates:
                            - -89.07944
                            - 42.264295
                          type: Point
                        name: updated_name_1
                        ops_group_handle: default
                        profile:
                          driver_handle: updated_driver_handle_1
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: updated_worker_handle_1
                      - created_at: 2024-07-09 18:14:30.061000
                        device:
                          device_id: UPDATED-DEVICE-ID-2
                          info:
                            device_brand: Apple
                            device_model: iPhone12,1
                            name: updated_name_2
                            network_operator: Visible
                            os_name: iOS
                            os_version: 15.6.0
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: updated_driver_handle_2
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T07:01:10.609Z
                            value: active
                        distance: 68362
                        duration: 2495
                        location:
                          coordinates:
                            - -88.324998
                            - 42.034393
                          type: Point
                        name: updated_name_2
                        ops_group_handle: default
                        profile:
                          driver_handle: updated_driver_handle_2
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: updated_worker_handle_2
                      - created_at: 2024-07-10 11:17:42.495000
                        device:
                          device_id: UPDATED-DEVICE-ID-3
                          info:
                            device_brand: alps
                            device_model: S24 Ultra
                            name: updated_name_3
                            network_operator: T-Mobile
                            os_name: Android
                            os_version: "10"
                            sdk_version: 7.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: updated_driver_handle_3
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T06:48:11.753Z
                            value: active
                        distance: 120827
                        duration: 4443
                        location:
                          coordinates:
                            - -87.692175
                            - 42.011515
                          type: Point
                        name: updated_name_3
                        ops_group_handle: default
                        profile:
                          driver_handle: updated_driver_handle_3
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: updated_worker_handle_3
                      - created_at: 2025-04-01 12:38:41.792000
                        device:
                          device_id: UPDATED-DEVICE-ID-4
                          info:
                            device_brand: Apple
                            device_model: iPhone13,2
                            name: updated_name_4
                            network_operator: --
                            os_name: iOS
                            os_version: 18.3.1
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: updated_driver_handle_4
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T06:54:49.891Z
                            value: active
                        distance: 138605
                        duration: 4657
                        location:
                          coordinates:
                            - -87.938059
                            - 42.986098
                          type: Point
                        name: updated_name_4
                        ops_group_handle: default
                        profile:
                          driver_handle: updated_driver_handle_4
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: updated_worker_handle_4
                      - created_at: 2025-04-13 17:47:52.864000
                        device:
                          device_id: UPDATED-DEVICE-ID-5
                          info:
                            device_brand: Apple
                            device_model: iPhone17,4
                            name: updated_name_5
                            network_operator: --
                            os_name: iOS
                            os_version: 18.4.1
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: updated_driver_handle_5
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T05:49:38.493Z
                            value: active
                        distance: 143584
                        duration: 4717
                        location:
                          coordinates:
                            - -87.959918
                            - 43.041797
                          type: Point
                        name: updated_name_5
                        ops_group_handle: default
                        profile:
                          driver_handle: updated_driver_handle_5
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: updated_worker_handle_5
                      - created_at: 2024-08-24 02:26:26.748000
                        device:
                          device_id: UPDATED-DEVICE-ID-6
                          info:
                            device_brand: Apple
                            device_model: iPhone14,6
                            name: updated_name_6
                            network_operator: --
                            os_name: iOS
                            os_version: 18.3.1
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: updated_driver_handle_6
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T06:45:27.962Z
                            value: active
                        distance: 152366
                        duration: 4944
                        location:
                          coordinates:
                            - -87.917558
                            - 43.087834
                          type: Point
                        name: updated_name_6
                        ops_group_handle: default
                        profile:
                          driver_handle: updated_driver_handle_6
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: updated_worker_handle_6
                      - created_at: 2024-07-09 19:34:53.727000
                        device:
                          device_id: UPDATED-DEVICE-ID-7
                          info:
                            device_brand: Apple
                            device_model: iPhone17,4
                            name: updated_name_7
                            network_operator: --
                            os_name: iOS
                            os_version: 18.4.1
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: updated_driver_handle_7
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T07:36:30.426Z
                            value: active
                        distance: 146902
                        duration: 5002
                        location:
                          coordinates:
                            - -87.815815
                            - 41.676121
                          type: Point
                        name: updated_name_7
                        ops_group_handle: default
                        profile:
                          driver_handle: updated_driver_handle_7
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: updated_worker_handle_7
                nearby_order_handle_workers_response_example:
                  summary: Nearby API request response example. This is the list of workers which
                    are ranked based on their distance from the destination of
                    an order_handle.
                  value:
                    request_id: 9b47006e-34de-450d-8681-50fa2c519a79
                    summary:
                      no_route_workers: 0
                      outside_region_workers: 0
                      processed_workers: 2
                      total_workers: 2
                      unprocessed_workers: 0
                    workers:
                      - created_at: 2024-07-09 20:10:10.442000
                        device:
                          device_id: DEVICE-001
                          info:
                            device_brand: Apple
                            device_model: iPhone15,4
                            name: worker_alpha
                            network_operator: --
                            os_name: iOS
                            os_version: 18.4.1
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: worker_alpha
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T08:30:45.224Z
                            value: active
                        distance: 2696
                        duration: 236
                        location:
                          coordinates:
                            - -88.997979
                            - 42.262501
                          type: Point
                        name: worker_alpha
                        ops_group_handle: default
                        profile:
                          driver_handle: worker_alpha
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: worker_alpha
                      - created_at: 2024-07-09 18:52:01.346000
                        device:
                          device_id: DEVICE-002
                          info:
                            device_brand: samsung
                            device_model: SM-S908U1
                            name: worker_bravo
                            network_operator: AT&T
                            os_name: Android
                            os_version: "14"
                            sdk_version: 7.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: worker_bravo
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T08:39:29.562Z
                            value: active
                        distance: 120822
                        duration: 4530
                        location:
                          coordinates:
                            - -87.682951
                            - 41.994821
                          type: Point
                        name: worker_bravo
                        ops_group_handle: default
                        profile:
                          driver_handle: worker_bravo
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: worker_bravo
                nearby_place_handle_workers_response_example:
                  summary: Nearby API request response example. This is the list of workers which
                    are ranked based on their distance from a place_handle
                  value:
                    request_id: 9b47006e-34de-450d-8681-50fa2c519a79
                    summary:
                      no_route_workers: 0
                      outside_region_workers: 0
                      processed_workers: 2
                      total_workers: 2
                      unprocessed_workers: 0
                    workers:
                      - created_at: 2024-07-09 20:10:10.442000
                        device:
                          device_id: DEVICE-001
                          info:
                            device_brand: Apple
                            device_model: iPhone15,4
                            name: worker_alpha
                            network_operator: --
                            os_name: iOS
                            os_version: 18.4.1
                            sdk_version: 5.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: worker_alpha
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T08:30:45.224Z
                            value: active
                        distance: 2696
                        duration: 236
                        location:
                          coordinates:
                            - -88.997979
                            - 42.262501
                          type: Point
                        name: worker_alpha
                        ops_group_handle: default
                        profile:
                          driver_handle: worker_alpha
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: worker_alpha
                      - created_at: 2024-07-09 18:52:01.346000
                        device:
                          device_id: DEVICE-002
                          info:
                            device_brand: samsung
                            device_model: SM-S908U1
                            name: worker_bravo
                            network_operator: AT&T
                            os_name: Android
                            os_version: "14"
                            sdk_version: 7.11.0+74d1fabf
                            timezone: America/Chicago
                          profile:
                            driver_handle: worker_bravo
                          status:
                            data:
                              activity: unknown
                              recorded_at: 2025-05-16T08:39:29.562Z
                            value: active
                        distance: 120822
                        duration: 4530
                        location:
                          coordinates:
                            - -87.682951
                            - 41.994821
                          type: Point
                        name: worker_bravo
                        ops_group_handle: default
                        profile:
                          driver_handle: worker_bravo
                        timezone: America/Chicago
                        work_status:
                          available: false
                          tracking: true
                        worker_handle: worker_bravo
          description: Successful response
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                route_not_found:
                  summary: route_not_found
                  value:
                    code: route_not_found
                    title: Route could not be found
                    detail: Could not generate a route from the device location to the set
                      destination
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                place_not_found:
                  summary: place_not_found
                  value:
                    code: place_not_found
                    title: Place not found
                    detail:
                      description: Place not found for the id or handle
                order_not_found:
                  summary: order_not_found
                  value:
                    code: order_not_found
                    title: Order Not Found
                    detail:
                      description: Order not found for handle sample-order-handle
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                route_error:
                  summary: route_error
                  value:
                    code: route_error
                    title: Failed to generate the route
                    detail: Server could not complete the route generation
      tags:
        - Nearby
      summary: Get all nearby workers
      description: "Use this API to get all the nearby workers from order destination.
        A maximum of 1000 workers are returned in order of their haversine
        distance from order destination. Note: if the search_radius filter is
        not specified, it uses the maximum allowed search radius of 100 miles
        (160934 meters)."
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NearbyRequest"
            examples:
              nearby_workers_example:
                summary: Use this POST Worker Nearby API request as an example to find available
                  workers near location of interest to perform a dispatch
                  operation.
                value:
                  order:
                    destination:
                      geometry:
                        coordinates:
                          - -88.97936034469119
                          - 42.2714428209251
                        type: Point
                  search_type: region
              filtered_nearby_workers_example:
                summary: Use this POST Worker Nearby API request to find available workers near
                  a location of interest that also satisfy certain
                  profile/search criteria.
                value:
                  order:
                    destination:
                      geometry:
                        coordinates:
                          - -88.97936034469119
                          - 42.2714428209251
                        type: Point
                  search_type: region
                  search_filter:
                    search_radius: 8300
              eta_workers_example:
                summary: Use this POST Worker Nearby API request to get estimates of a list of
                  workers to the location of interest.
                value:
                  order:
                    destination:
                      geometry:
                        coordinates:
                          - -88.97936034469119
                          - 42.2714428209251
                        type: Point
                  search_type: eta
                  search_filter:
                    worker_list:
                      - worker_alpha
                      - worker_bravo
              eta_nearby_workers_example:
                summary: Use this POST Worker Nearby API request to get estimates of drive
                  duration and drive distance for nearby workers to the location
                  of interest.
                value:
                  order:
                    destination:
                      geometry:
                        coordinates:
                          - -88.97936034469119
                          - 42.2714428209251
                        type: Point
                  search_type: eta
              nearby_order_handle_workers_example:
                summary: Use this POST Worker Nearby API request as an example to find available
                  workers near destination of an order_handle to perform a
                  dispatch operation.
                value:
                  order:
                    order_handle: sample-order-handle
                  search_type: region
              nearby_place_handle_workers_example:
                summary: Use this POST Worker Nearby API request as an example to find available
                  workers near a place_handle
                value:
                  order:
                    destination:
                      place_handle: sample-place-handle
                  search_type: region
      security:
        - BasicAuth: []
        - TokenAuth: []
  /nearby/v3:
    post:
      parameters: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/NearbyResponse1"
              examples:
                nearby_drivers_response_example:
                  summary: Nearby API request response example. This is the list of devices which
                    are ranked based on their distance from the location of
                    interest (nearest first).
                  value:
                    drivers:
                      - device:
                          device_id: 00112233-2F48-4DA1-ACEA-8A8D530670CF
                          info:
                            timezone: America/Los Angeles
                            os_name: iOS
                            device_brand: Apple
                            sdk_version: func test app
                            device_model: IPhone X
                            network_operator: T-Mobile
                            name: Func Test Device
                            os_version: 12.1.4
                            os_hardware_identifier: 719bef31-e487-46e0-86f1-5f32589fd9eb
                          profile:
                            gig_type: ridesharing
                          status:
                            value: active
                            data:
                              activity: drive
                              recorded_at: 2022-06-30T13:35:14.806Z
                        location:
                          coordinates:
                            - -122.3999933082254
                            - 37.793651385106074
                          type: Point
                        duration: null
                        distance: 9303
                        ongoing_trip: null
                        error: null
                    summary:
                      total_drivers: 1
                      processed_drivers: 1
                      unprocessed_drivers: 0
                      outside_region_drivers: 0
                      no_route_drivers: 0
                filtered_nearby_drivers_response_example:
                  summary: Nearby API request response example filtered by profile. This is the
                    list of devices which are ranked based on their distance
                    from the location of interest (nearest first) and match the
                    specified profile.
                  value:
                    drivers:
                      - device:
                          device_id: 00112233-2F48-4DA1-ACEA-8A8D530670CF
                          info:
                            timezone: America/Los Angeles
                            os_name: iOS
                            device_brand: Apple
                            sdk_version: func test app
                            device_model: IPhone X
                            network_operator: T-Mobile
                            name: Func Test Device
                            os_version: 12.1.4
                            os_hardware_identifier: 719bef31-e487-46e0-86f1-5f32589fd9eb
                          profile:
                            gig_type: ridesharing
                          status:
                            value: active
                            data:
                              activity: drive
                              recorded_at: 2022-06-30T13:35:14.806Z
                        location:
                          coordinates:
                            - -122.3999933082254
                            - 37.793651385106074
                          type: Point
                        duration: null
                        distance: 9303
                        ongoing_trip: null
                        error: null
                    summary:
                      total_drivers: 1
                      processed_drivers: 1
                      unprocessed_drivers: 0
                      outside_region_drivers: 0
                      no_route_drivers: 0
                eta_drivers_response_example:
                  summary: Nearby API request response example for getting ETA of a list of
                    drivers. This is the list of devices which are ranked based
                    on their drive duration from the location of interest
                    (nearest first).
                  value:
                    drivers:
                      - device:
                          device_id: 00112233-2A7E-4D17-BF76-90926FD82E7C
                          info:
                            timezone: America/Los Angeles
                            os_name: iOS
                            device_brand: Apple
                            sdk_version: func test app
                            device_model: IPhone X
                            network_operator: T-Mobile
                            name: Func Test Device
                            os_version: 12.1.4
                            os_hardware_identifier: ac75716e-4cef-4ef6-be1c-92cfc8e7c2f4
                          profile:
                            key_0: dc202869-c931-4093-b778-9908a8eb3904
                          status:
                            value: active
                            data:
                              activity: unknown
                              recorded_at: 2022-06-27T07:59:37.290Z
                        location:
                          geometry:
                            type: Point
                            coordinates:
                              - 35.402007
                              - 47.792524
                        duration: 2927
                        distance: 21528
                        ongoing_trip: null
                        error: null
                    summary:
                      total_drivers: 14
                      processed_drivers: 1
                      unprocessed_drivers: 1
                      outside_region_drivers: 12
                      no_route_drivers: 0
                eta_nearby_drivers_response_example:
                  summary: Nearby API request response example for getting ETA of nearby drivers.
                    This is the list of devices which are ranked based on their
                    drive duration from the location of interest (nearest
                    first).
                  value:
                    drivers:
                      - device:
                          device_id: 00112233-2A7E-4D17-BF76-90926FD82E7C
                          info:
                            timezone: America/Los Angeles
                            os_name: iOS
                            device_brand: Apple
                            sdk_version: func test app
                            device_model: IPhone X
                            network_operator: T-Mobile
                            name: Func Test Device
                            os_version: 12.1.4
                            os_hardware_identifier: ac75716e-4cef-4ef6-be1c-92cfc8e7c2f4
                          profile:
                            key_0: dc202869-c931-4093-b778-9908a8eb3904
                          status:
                            value: active
                            data:
                              activity: unknown
                              recorded_at: 2022-06-27T07:59:37.290Z
                        location:
                          geometry:
                            type: Point
                            coordinates:
                              - 35.402007
                              - 47.792524
                        duration: 2927
                        distance: 21528
                        ongoing_trip: null
                        error: null
                    summary:
                      total_drivers: 1
                      processed_drivers: 1
                      unprocessed_drivers: 0
                      outside_region_drivers: 0
                      no_route_drivers: 0
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Nearby
      summary: Get all nearby drivers
      description: "Use this API to get all the nearby drivers from order destination.
        A maximum of 1000 drivers are returned in order of their haversine
        distance from order destination around search radius of 100 miles
        (160934 meters). Note: if the search_radius filter is not specified it
        uses the maximum allowed search radius."
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/NearbyRequest1"
            examples:
              nearby_drivers_example:
                summary: Use this POST Device Nearby API request as an example to find available
                  devices near location of interest to perform a dispatch
                  operation.
                value:
                  order:
                    destination:
                      geometry:
                        coordinates:
                          - -122.3599933082254
                          - 37.753651385106075
                        type: Point
                  search_type: region
              filtered_nearby_drivers_example:
                summary: Use this POST Device Nearby API request to find available devices near
                  a location of interest that also satisfy certain profile
                  criteria.
                value:
                  order:
                    destination:
                      geometry:
                        coordinates:
                          - -122.3599933082254
                          - 37.753651385106075
                        type: Point
                    order_id: your_order_id
                    metadata:
                      order_type: grocery
                  search_type: region
                  search_filter:
                    driver_profile:
                      gig_type: ridesharing
                    include_on_trip: true
                    search_radius: 15000
              eta_drivers_example:
                summary: Use this POST Device Nearby API request to get estimates of a list of
                  drivers to the location of interest.
                value:
                  order:
                    destination:
                      geometry:
                        coordinates:
                          - 35.502007
                          - 47.892524
                        type: Point
                  search_type: eta
                  search_filter:
                    driver_list:
                      - 00112233-6A5F-4F6E-9231-8480A4438064
                      - 00112233-2A7E-4D17-BF76-90926FD82E7C
                      - 00112233-B622-486D-A76F-FEB522B345E6
              eta_nearby_drivers_example:
                summary: Use this POST Device Nearby API request to get estimates of drive
                  duration and drive distance for nearby drivers to the location
                  of interest.
                value:
                  order:
                    destination:
                      geometry:
                        coordinates:
                          - -122.3599933082254
                          - 37.753651385106075
                        type: Point
                  search_type: eta
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/track:
    post:
      parameters: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TrackOrdersResponse"
              examples:
                Create and track orders:
                  summary: Create and track orders
                  value:
                    route_handle: 7ac07153-5590-46c5-9ada-a6ca84f5b48f
                    status: tracking
                    version: 1
                    embed_url: https://embed.hypertrack.com/routes/7ac07153-5590-46c5-9ada-a6ca84f5b48f?publishable_key=a4pvdQPekFgLSuZrwivhJS_Squ6irX1n9sRBIn9nl3PTK-5y3BO56rolpGuzhp1pIoH4TiDyqWIq8IEkOJF5ed
                    orders:
                      - order_handle: order-1
                        fulfillment_attempt: 0
                        status: ongoing
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - 17.803927
                              - 34.832173
                          address: 1709 Automation Pkwy, San Jose, CA 95101
                          radius: 100
                        track_mode: on_time
                        scheduled_at: 2023-11-02T02:00:00.000Z
                        started_at: 2023-11-01T22:47:56.027Z
                        type: pick
                        type_index: 0
                        expected_service_time: 0
                        capacity_used: 1
                        share_url: https://trck.at/PvR4MmWOpw
                        device_id: FFA58DDB-5CA0-4CD5-8BDE-E4EC7E077E3D
                        worker_handle: james@ht.com
                        created_at: 2023-11-01T22:47:53.512Z
                        assigned_at: 2023-11-01T22:47:53.857Z
                        route_handle: 7ac07153-5590-46c5-9ada-a6ca84f5b48f
                        planned_at: 2023-11-01T22:47:53.512Z
                      - order_handle: order-2
                        fulfillment_attempt: 0
                        status: ongoing
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - 17.803926
                              - 34.832174
                          address: 748 Story Rd, San Jose, CA 95112
                          radius: 100
                        track_mode: on_time
                        scheduled_at: 2023-11-02T02:00:00.000Z
                        started_at: 2023-11-01T22:47:56.092Z
                        type: drop
                        type_index: 0
                        expected_service_time: 0
                        capacity_used: 1
                        share_url: https://trck.at/NqV7Xm22pC
                        device_id: FFA58DDB-5CA0-4CD5-8BDE-E4EC7E077E3D
                        worker_handle: james@ht.com
                        created_at: 2023-11-01T22:47:53.512Z
                        assigned_at: 2023-11-01T22:47:53.914Z
                        route_handle: 7ac07153-5590-46c5-9ada-a6ca84f5b48f
                        planned_at: 2023-11-01T22:47:53.512Z
                    started_at: 2023-11-01T22:47:54.867Z
                    assigned_at: 2023-11-01T22:47:53.968Z
                    created_at: 2023-11-01T22:47:53.659Z
                    device_id: FFA58DDB-5CA0-4CD5-8BDE-E4EC7E077E3D
                    worker_handle: james@ht.com
                    planned_at: 2023-11-01T22:47:53.658Z
                Track orders using the route_handle:
                  summary: Track orders using route_handle
                  value:
                    route_handle: 7ac07153-5590-46c5-9ada-a6ca84f5b48f
                    status: tracking
                    version: 1
                    embed_url: https://embed.hypertrack.com/routes/7ac07153-5590-46c5-9ada-a6ca84f5b48f?publishable_key=a4pvdQPekFgLSuZrwivhJS_Squ6irX1n9sRBIn9nl3PTK-5y3BO56rolpGuzhp1pIoH4TiDyqWIq8IEkOJF5ed
                    orders:
                      - order_handle: order-1
                        fulfillment_attempt: 0
                        status: ongoing
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - 17.803927
                              - 34.832173
                          address: 1709 Automation Pkwy, San Jose, CA 95101
                          radius: 100
                        track_mode: on_time
                        scheduled_at: 2023-11-02T02:00:00.000Z
                        started_at: 2023-11-01T22:47:56.027Z
                        type: pick
                        type_index: 0
                        expected_service_time: 0
                        capacity_used: 1
                        share_url: https://trck.at/PvR4MmWOpw
                        device_id: FFA58DDB-5CA0-4CD5-8BDE-E4EC7E077E3D
                        worker_handle: james@ht.com
                        created_at: 2023-11-01T22:47:53.512Z
                        assigned_at: 2023-11-01T22:47:53.857Z
                        route_handle: 7ac07153-5590-46c5-9ada-a6ca84f5b48f
                        planned_at: 2023-11-01T22:47:53.512Z
                      - order_handle: order-2
                        fulfillment_attempt: 0
                        status: ongoing
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - 17.803926
                              - 34.832174
                          address: 748 Story Rd, San Jose, CA 95112
                          radius: 100
                        track_mode: on_time
                        scheduled_at: 2023-11-02T02:00:00.000Z
                        started_at: 2023-11-01T22:47:56.092Z
                        type: drop
                        type_index: 0
                        expected_service_time: 0
                        capacity_used: 1
                        share_url: https://trck.at/NqV7Xm22pC
                        device_id: FFA58DDB-5CA0-4CD5-8BDE-E4EC7E077E3D
                        worker_handle: james@ht.com
                        created_at: 2023-11-01T22:47:53.512Z
                        assigned_at: 2023-11-01T22:47:53.914Z
                        route_handle: 7ac07153-5590-46c5-9ada-a6ca84f5b48f
                        planned_at: 2023-11-01T22:47:53.512Z
                    started_at: 2023-11-01T22:47:54.867Z
                    assigned_at: 2023-11-01T22:47:53.968Z
                    created_at: 2023-11-01T22:47:53.659Z
                    device_id: FFA58DDB-5CA0-4CD5-8BDE-E4EC7E077E3D
                    worker_handle: james@ht.com
                    planned_at: 2023-11-01T22:47:53.658Z
          description: Successful response
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                driver_not_linked_to_device:
                  summary: driver_not_linked_to_device
                  value:
                    code: driver_not_linked_to_device
                    title: Worker needs to be linked to a device first
                    detail:
                      description: The worker is not yet linked to a device
                route validation_error:
                  summary: validation_error
                  value:
                    code: validation_error
                    title: Order request is malformed
                    detail: The request does not have the correct format. Please review the invalid
                      parameters
                route already completed validation_error:
                  summary: validation_error__2
                  value:
                    code: validation_error
                    title: Route already completed
                    detail: Route with the given ID is already completed
                route already tracking validation_error:
                  summary: validation_error__3
                  value:
                    code: validation_error
                    title: Route already tracking
                    detail: Route with the given ID is already tracking
                route cannot be tracked validation_error:
                  summary: validation_error__4
                  value:
                    code: validation_error
                    title: Route can not be tracked
                    detail: Route with the given ID can not be tracked
                ops_group_not_defined:
                  summary: ops_group_not_defined
                  value:
                    code: ops_group_not_defined
                    title: Ops Group is not defined
                    detail:
                      description: Ops Group <ops_group_handle> does not exist
                destination_place_not_found:
                  summary: destination_place_not_found
                  value:
                    code: destination_place_not_found
                    title: Place not found
                    detail:
                      description: Place not defined for place handle <place_handle> in order
                        destination for order <order_handle>
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                driver_not_found:
                  summary: driver_not_found
                  value:
                    code: driver_not_found
                    title: Worker Not Found
                    detail:
                      description: Worker not found for handle <driver_handle>
                route_not_found:
                  summary: route_not_found
                  value:
                    code: route_not_found
                    title: Route does not exist
                    detail: Route with this ID does not exist in the system
                driver_deleted:
                  summary: driver_deleted
                  value:
                    code: driver_deleted
                    title: Worker is in deleted state for given handle
                    detail: Worker with the given handle is in deleted state. Please undelete it
                      using Workers API
                device_not_found:
                  summary: device_not_found
                  value:
                    code: device_not_found
                    title: Device could not be found
                    detail: null
                geofence_not_found:
                  summary: geofence_not_found
                  value:
                    code: geofence_not_found
                    title: Geofence Not Found
                    detail:
                      description: Geofence not found for id <geofence_id>
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                route duplicate_resource:
                  summary: duplicate_resource
                  value:
                    code: duplicate_resource
                    title: Duplicate route found with this ID
                    detail: System already has a route with this ID
                order duplicate_resource:
                  summary: duplicate_resource__2
                  value:
                    code: duplicate_resource
                    title: Duplicate order handle found
                    detail: System already has an incompleted order with this handle. Please
                      complete or cancel it first
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Track Orders
      description: This API allows the creation and immediate tracking of order
        fulfillment. If the route has been planned and exists in the HyperTrack
        system, then tracking can be initiated using the route_handle.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TrackOrdersRequest"
            examples:
              Create and track orders:
                summary: Create and track orders
                value:
                  worker_handle: james@ht.com
                  track_mode: on_time
                  ops_group_handle: SAN_JOSE_WH
                  orders:
                    - order_handle: order-1
                      type: pick
                      scheduled_at: 2023-11-02T02:00:00Z
                      destination:
                        address: 1709 Automation Pkwy, San Jose, CA 95101
                        geometry:
                          type: Point
                          coordinates:
                            - 17.803927
                            - 34.832173
                        radius: 100
                    - order_handle: order-2
                      type: drop
                      scheduled_at: 2023-11-02T02:00:00Z
                      destination:
                        address: 748 Story Rd, San Jose, CA 95112
                        geometry:
                          type: Point
                          coordinates:
                            - 17.803927
                            - 34.832173
                        radius: 100
              Track orders using the route_handle:
                summary: Track orders using the route_handle
                value:
                  track_mode: on_time
                  route_handle: 7ac07153-5590-46c5-9ada-a6ca84f5b48f
                  device_id: FFA58DDB-5CA0-4CD5-8BDE-E4EC7E077E3D
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/plans:
    get:
      parameters:
        - in: query
          name: fulfillment_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve plans that are
            fulfilled on a given date.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: ops_group_handle
          description: Unique Handle of Ops Group to fetch plans for
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Encoded value provided by our API to retrieve the next page of plans
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: status
          description: String representation of Plan status to fetch plans for.
          schema:
            type: string
            enum:
              - failed
              - completed
              - planning
            nullable: true
          required: false
        - in: query
          name: sort_direction
          description: String indicating the preferred sorting type
          schema:
            default: desc
            enum:
              - desc
              - asc
            nullable: true
          required: false
        - in: query
          name: include_summary
          description: Flag to fetch summary also for each plan.
          schema:
            type: boolean
            default: false
            nullable: true
          required: false
        - in: query
          name: limit
          description: Number of plans to be fetched.
          schema:
            type: integer
            default: 50
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetPlansResponse"
              example:
                plans:
                  - plan_id: 352a45c3-99b7-4528-9eca-a6f318c2ca23
                    status: failed
                    started_at: 2023-10-19T12:34:45.000Z
                    fulfillment_date: 2023-10-19
                    created_at: 2023-10-19T12:32:45.000Z
                    ops_group_handle: d57deee8-d75f-4db5-ad37-4985ddcb47ac
                    sequence_number: 2
                    failure_reason: No Workers Available
                    routes:
                      - route_handle: route-1
                        ops_group_handle: SAN_JOSE_WH
                        plan_mode: manual
                        status: completed
                        completed_at: 2023-03-14T23:55:00Z
                        worker_handle: James
                        version: 1
                        estimate:
                          start_by: 2023-03-14T23:20:00Z
                          distance: 1000
                          duration: 600
                          polyline:
                            type: LineString
                            coordinates:
                              - - 77.72123
                                - 12.89617
                              - - 77.72169
                                - 12.89595
                              - - 77.72214
                                - 12.89572
                          start_location:
                            type: Point
                            coordinates:
                              - -121.8924515
                              - 37.4124516
                          end_location:
                            type: Point
                            coordinates:
                              - -121.8984515
                              - 37.5124516
                        orders:
                          - order_handle: order-101
                            fulfillment_attempt: 1
                            status: completed
                            completed_at: 2023-03-14T23:55:00Z
                            ops_group_handle: store-sjc
                            worker_handle: James
                            device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                            created_at: 2023-03-14T23:00:00Z
                            scheduled_at: 2023-03-14T23:50:00Z
                            scheduled_after: 2023-03-14T23:20:00Z
                            metadata:
                              customerId: "1223344"
                            region:
                              city: Fremont
                              state: California
                              country: United States of America
                            destination:
                              geometry:
                                type: Point
                                coordinates:
                                  - -121.8984515
                                  - 37.5124516
                              radius: 50
                              address: Mission Peak, Fremont CA 94539
                            risk_status: false
                            expected_service_time: 600
                            product_type:
                              - plumber
                            type: drop
                            capacity_used: 5
                        device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                        metadata:
                          customerId: "4255534"
                          zone: 4
                        embed_url: https://embed.hypertrack.com/dkdkddnd
                    unplanned_orders:
                      - order_handle: ORD_1223
                        status: unplanned
                        type: drop
                        planning_failure_reason: The optimizer dropped this order to satisfy planning
                          constraints for the overall plan.
                pagination_token: bvdshjbcjksbcjk
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Plans
      description: >-
        API to fetch list of plans based on a set of filters


        ### Planning failure reasons


        When an order is left unplanned by automated planning,
        `planning_failure_reason` may contain one of these values:


        - `No Worker was available for this plan.`

        - `No Worker schedule overlaps with this order's time window.`

        - `This order is outside the available Worker working hours.`

        - `Worker location is unavailable, so travel time could not be
        evaluated.`

        - `Worker start location is unavailable for the configured route start
        setting.`

        - `No Worker supports the required product type for this order.`

        - `Route was being modified concurrently and this order needs to be
        re-planned.`

        - `The optimizer dropped this order to satisfy planning constraints for
        the overall plan.`

        - `The optimizer could not find a feasible plan for the provided
        constraints.`

        - `Travel time calculation failed for this planning attempt.`

        - `Ops group configuration is incomplete for automated planning.`

        - `Assigning this order would exceed route or Worker capacity.`

        - `No Worker can reach this order before scheduled_at.`

        - `Assigning this order would delay an already planned downstream
        order.`

        - `Assigning this order would exceed the Worker's shift end time.`

        - `Automated planning could not assign this order with the provided
        constraints.`
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/plans/:
    get:
      parameters:
        - in: query
          name: fulfillment_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve plans that are
            fulfilled on a given date.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: ops_group_handle
          description: Unique Handle of Ops Group to fetch plans for
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Encoded value provided by our API to retrieve the next page of plans
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: status
          description: String representation of Plan status to fetch plans for.
          schema:
            type: string
            enum:
              - failed
              - completed
              - planning
            nullable: true
          required: false
        - in: query
          name: sort_direction
          description: String indicating the preferred sorting type
          schema:
            default: desc
            enum:
              - desc
              - asc
            nullable: true
          required: false
        - in: query
          name: include_summary
          description: Flag to fetch summary also for each plan.
          schema:
            type: boolean
            default: false
            nullable: true
          required: false
        - in: query
          name: limit
          description: Number of plans to be fetched.
          schema:
            type: integer
            default: 50
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetPlansResponse"
              example:
                plans:
                  - plan_id: 352a45c3-99b7-4528-9eca-a6f318c2ca23
                    status: failed
                    started_at: 2023-10-19T12:34:45.000Z
                    fulfillment_date: 2023-10-19
                    created_at: 2023-10-19T12:32:45.000Z
                    ops_group_handle: d57deee8-d75f-4db5-ad37-4985ddcb47ac
                    sequence_number: 2
                    failure_reason: No Workers Available
                    routes:
                      - route_handle: route-1
                        ops_group_handle: SAN_JOSE_WH
                        plan_mode: manual
                        status: completed
                        completed_at: 2023-03-14T23:55:00Z
                        worker_handle: James
                        version: 1
                        estimate:
                          start_by: 2023-03-14T23:20:00Z
                          distance: 1000
                          duration: 600
                          polyline:
                            type: LineString
                            coordinates:
                              - - 77.72123
                                - 12.89617
                              - - 77.72169
                                - 12.89595
                              - - 77.72214
                                - 12.89572
                          start_location:
                            type: Point
                            coordinates:
                              - -121.8924515
                              - 37.4124516
                          end_location:
                            type: Point
                            coordinates:
                              - -121.8984515
                              - 37.5124516
                        orders:
                          - order_handle: order-101
                            fulfillment_attempt: 1
                            status: completed
                            completed_at: 2023-03-14T23:55:00Z
                            ops_group_handle: store-sjc
                            worker_handle: James
                            device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                            created_at: 2023-03-14T23:00:00Z
                            scheduled_at: 2023-03-14T23:50:00Z
                            scheduled_after: 2023-03-14T23:20:00Z
                            metadata:
                              customerId: "1223344"
                            region:
                              city: Fremont
                              state: California
                              country: United States of America
                            destination:
                              geometry:
                                type: Point
                                coordinates:
                                  - -121.8984515
                                  - 37.5124516
                              radius: 50
                              address: Mission Peak, Fremont CA 94539
                            risk_status: false
                            expected_service_time: 600
                            product_type:
                              - plumber
                            type: drop
                            capacity_used: 5
                        device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                        metadata:
                          customerId: "4255534"
                          zone: 4
                        embed_url: https://embed.hypertrack.com/dkdkddnd
                    unplanned_orders:
                      - order_handle: ORD_1223
                        status: unplanned
                        type: drop
                        planning_failure_reason: The optimizer dropped this order to satisfy planning
                          constraints for the overall plan.
                pagination_token: bvdshjbcjksbcjk
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Plans
      description: >-
        API to fetch list of plans based on a set of filters


        ### Planning failure reasons


        When an order is left unplanned by automated planning,
        `planning_failure_reason` may contain one of these values:


        - `No Worker was available for this plan.`

        - `No Worker schedule overlaps with this order's time window.`

        - `This order is outside the available Worker working hours.`

        - `Worker location is unavailable, so travel time could not be
        evaluated.`

        - `Worker start location is unavailable for the configured route start
        setting.`

        - `No Worker supports the required product type for this order.`

        - `Route was being modified concurrently and this order needs to be
        re-planned.`

        - `The optimizer dropped this order to satisfy planning constraints for
        the overall plan.`

        - `The optimizer could not find a feasible plan for the provided
        constraints.`

        - `Travel time calculation failed for this planning attempt.`

        - `Ops group configuration is incomplete for automated planning.`

        - `Assigning this order would exceed route or Worker capacity.`

        - `No Worker can reach this order before scheduled_at.`

        - `Assigning this order would delay an already planned downstream
        order.`

        - `Assigning this order would exceed the Worker's shift end time.`

        - `Automated planning could not assign this order with the provided
        constraints.`
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/export:
    post:
      parameters: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrderExportResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
        - Export
      summary: Create an order export job
      description: Creates an asynchronous job to export orders to CSV.gz file.
        Returns a job_id that can be used to check status. Download link will be
        sent via email when ready.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OrderExportRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/routes/:
    get:
      parameters:
        - in: query
          name: completed_at_date
          description: Filter for routes completed on specified date (YYYY-MM-DD)
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: completed_at_from
          description: Filter for routes completed after specified timestamp (YYYY-MM-DD
            HH:mm:ss)
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: completed_at_to
          description: Filter for routes completed before specified timestamp (YYYY-MM-DD
            HH:mm:ss)
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: created_at_date
          description: Filter for routes created on specified date (YYYY-MM-DD)
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: created_at_from
          description: Filter for routes created after specified timestamp (YYYY-MM-DD
            HH:mm:ss)
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: created_at_to
          description: Filter for routes created before specified timestamp (YYYY-MM-DD
            HH:mm:ss)
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: worker_handle
          description: Unique customer provided identifier of the worker to used retrieve
            routes associated with the specified worker
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: driver_handle
          description: Unique customer provided identifier of the driver to used retrieve
            routes associated with the specified driver
          schema:
            type: string
            nullable: true
            deprecated: true
          required: false
        - in: query
          name: ops_group_handle
          description: Filter for routes on specified ops group handle or list of comma
            separated handles
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: plan_mode
          description: Filter for routes on specified plan mode (`manual` -> routes
            created manually, `scheduled` -> routes created automatically)
          schema:
            type: string
            enum:
              - on_demand
              - scheduled
              - manual
            nullable: true
          required: false
        - in: query
          name: planned_at_date
          description: Filter for routes planned on specified date (YYYY-MM-DD).
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: planned_at_from
          description: Filter for routes planned after specified timestamp (YYYY-MM-DD
            HH:mm:ss)
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: planned_at_to
          description: Filter for routes planned before specified timestamp (YYYY-MM-DD
            HH:mm:ss)
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: region_filter
          description: JSON object containing `city`, `state`, or `country` used to filter
            routes
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: route_metadata_filter
          description: JSON object representing route metadata to be used to filter routes
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: sort_direction
          description: Sort route responses by `asc` or `desc` on the created_at timestamp
          schema:
            type: string
            enum:
              - asc
              - desc
            nullable: true
          required: false
        - in: query
          name: start_by_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve routes that need to
            start by the given date
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: start_by_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            routes that need to start within a timeframe
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: start_by_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            routes that need to start within a timeframe
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: started_at_date
          description: Date (YYYY-MM-DD) used as a filter to retrieve routes that started
            on a given date
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: started_at_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            routes that started within a timeframe
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: started_at_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            routes that started within a timeframe
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: scheduled_start_at_from
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            routes that scheduled start within a timeframe
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: scheduled_start_at_to
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            routes that scheduled start within a timeframe
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: status
          description: Filter for routes that are `planned`, `assigned`, `tracking`, or
            `completed`, to filter for multiple statuses, pass them as comma
            separated values
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: track_mode
          description: Filter for routes that are `on_time`, `flex`, `on_shift`,
            `pre_shift` or `full_shift`
          schema:
            type: string
            enum:
              - on_time
              - flex
              - full_shift
              - on_shift
              - pre_shift
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Encoded value provided by our API to retrieve the next page of routes
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: search_term
          description: String representing the search term. Search will be done on
            route_handle, ops_group_handle, worker_handle and metadata fields.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Max results to fetch
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: device_switch_mode
          description: Filter for routes with a device_switch_mode
          schema:
            enum:
              - manual
              - login
              - closest_to_destination
            nullable: true
          required: false
        - in: query
          name: plan_id
          description: Filter by plan id
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: device_id
          description: Filter by device id
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: device_metadata_filter
          description: JSON object representing device metadata to be used to filter routes
          schema:
            type: string
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetRoutesResponse"
              examples:
                Filtered by ops_group_handle and completion date:
                  summary: Filtered by ops_group_handle and completion date
                  value:
                    routes:
                      - route_handle: afb94d64-2702-4efa-b938-d1facfd7832e
                        status: completed
                        version: 1
                        embed_url: null
                        orders:
                          - order_handle: order-1
                            status: cancelled
                            type: drop
                            type_index: 0
                            estimate:
                              distance: 73863
                              duration: 3614
                              start_by: 2023-10-31T02:59:46.000Z
                            cancelled_at: 2023-10-31T00:12:56.688Z
                            expected_service_time: 0
                          - order_handle: order-2
                            status: cancelled
                            type: pick
                            type_index: 0
                            estimate:
                              distance: 75766
                              duration: 3732
                              start_by: 2023-10-31T00:57:48.000Z
                            cancelled_at: 2023-10-31T00:13:01.073Z
                            expected_service_time: 0
                        ops_group_handle: store-SF
                        started_at: 2023-10-31T00:57:48.000Z
                        created_at: 2023-10-31T00:12:22.767Z
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        completed_at: 2023-10-31T00:13:01.255Z
                        plan_mode: manual
                        plan_id: a7a9c72e-bf31-44f5-8a59-c4fffb5fb9d4
                      - route_handle: a3f6e79c-c830-4766-8a3d-9eeaa5099ce1
                        status: completed
                        version: 1
                        embed_url: https://embed.hypertrack.com/trips/a3f6e79c-c830-4766-8a3d-9eeaa5099ce2?publishable_key=a5pvd2PekFvSSuZrwivgJS_Ssd6irX1n9qRBIn9nl3PTK-5y3BO56rolpGuzhp1pIoH4TiDyqWIq8IEkOJCqeg
                        orders:
                          - order_handle: order-3
                            status: cancelled
                            type: pick
                            type_index: 0
                            estimate:
                              distance: 75766
                              duration: 3732
                              start_by: 2023-10-31T00:57:48.000Z
                            cancelled_at: 2023-10-31T23:13:13.926Z
                            expected_service_time: 0
                          - order_handle: order-4
                            status: completed
                            type: drop
                            type_index: 0
                            estimate:
                              distance: 73514
                              duration: 3571
                              start_by: 2023-10-31T03:00:29.000Z
                            completed_at: 2023-10-31T23:13:21.287Z
                            expected_service_time: 0
                        ops_group_handle: store-SF
                        started_at: 2023-10-31T03:00:29.000Z
                        assigned_at: 2023-10-31T23:13:03.788Z
                        created_at: 2023-10-31T23:12:55.529Z
                        device_id: 52223948-1A79-47CC-AB81-2FB0A59536D2
                        worker_handle: james@ht.com
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        completed_at: 2023-10-31T23:13:21.647Z
                        plan_mode: manual
                Filtered by worker and completion date:
                  summary: Filtered by worker and completion date
                  value:
                    routes:
                      - route_handle: a3f6e79c-c830-4766-8a3d-9eebb5099ce2
                        status: completed
                        version: 1
                        embed_url: https://embed.hypertrack.com/trips/a3f6e79c-c830-4766-8a3d-9eebb5099ce2?publishable_key=a5pvwQPekFvLSuWrwivgJS_Squ6irX1n9qRBIn9nl3PTK-5y3BO56rolpGuzhp1pIoH4TiDyqWIq8IEkOJF5ja
                        orders:
                          - order_handle: 23Oct30-5
                            status: cancelled
                            type: pick
                            type_index: 0
                            estimate:
                              distance: 75766
                              duration: 3732
                              start_by: 2023-10-31T00:57:48.000Z
                            cancelled_at: 2023-10-31T23:13:13.926Z
                            expected_service_time: 0
                          - order_handle: 23Oct30-4
                            status: completed
                            type: drop
                            type_index: 0
                            estimate:
                              distance: 73514
                              duration: 3571
                              start_by: 2023-10-31T03:00:29.000Z
                            completed_at: 2023-10-31T23:13:21.287Z
                            expected_service_time: 0
                        ops_group_handle: store-SF
                        started_at: 2023-10-31T03:00:29.000Z
                        assigned_at: 2023-10-31T23:13:03.788Z
                        created_at: 2023-10-31T23:12:55.529Z
                        device_id: 52193948-1W29-47CC-AB81-2FCCA59536D2
                        worker_handle: james@ht.com
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        completed_at: 2023-10-31T23:13:21.647Z
                        plan_mode: manual
                Filtered by status and schedule timerange:
                  summary: Filtered by status and schedule timerange
                  value:
                    routes:
                      - route_handle: afb94d64-2702-4efa-b938-d1facfd7832e
                        status: completed
                        version: 1
                        embed_url: null
                        orders:
                          - order_handle: order-1
                            status: cancelled
                            type: drop
                            type_index: 0
                            estimate:
                              distance: 73863
                              duration: 3614
                              start_by: 2023-10-31T02:59:46.000Z
                            cancelled_at: 2023-10-31T00:12:56.688Z
                            expected_service_time: 0
                          - order_handle: order-2
                            status: cancelled
                            type: pick
                            type_index: 0
                            estimate:
                              distance: 75766
                              duration: 3732
                              start_by: 2023-10-31T00:57:48.000Z
                            cancelled_at: 2023-10-31T00:13:01.073Z
                            expected_service_time: 0
                        ops_group_handle: store-SF
                        started_at: 2023-10-31T00:57:48.000Z
                        created_at: 2023-10-31T00:12:22.767Z
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        completed_at: 2023-10-31T00:13:01.255Z
                        plan_mode: manual
                        plan_id: a7a9c72e-bf31-44f5-8a59-c4fffb5fb9d4
                      - route_handle: a3f6e79c-c830-4766-8a3d-9eeaa5099ce1
                        status: completed
                        version: 1
                        embed_url: https://embed.hypertrack.com/trips/a3f6e79c-c830-4766-8a3d-9eeaa5099ce2?publishable_key=a5pvd2PekFvSSuZrwivgJS_Ssd6irX1n9qRBIn9nl3PTK-5y3BO56rolpGuzhp1pIoH4TiDyqWIq8IEkOJCqeg
                        orders:
                          - order_handle: order-3
                            status: cancelled
                            type: pick
                            type_index: 0
                            estimate:
                              distance: 75766
                              duration: 3732
                              start_by: 2023-10-31T00:57:48.000Z
                            cancelled_at: 2023-10-31T23:13:13.926Z
                            expected_service_time: 0
                          - order_handle: order-4
                            status: completed
                            type: drop
                            type_index: 0
                            estimate:
                              distance: 73514
                              duration: 3571
                              start_by: 2023-10-31T03:00:29.000Z
                            completed_at: 2023-10-31T23:13:21.287Z
                            expected_service_time: 0
                        ops_group_handle: store-SF
                        started_at: 2023-10-31T03:00:29.000Z
                        assigned_at: 2023-10-31T23:13:03.788Z
                        created_at: 2023-10-31T23:12:55.529Z
                        device_id: 52223948-1A79-47CC-AB81-2FB0A59536D2
                        worker_handle: james@ht.com
                        region:
                          country: United States
                          city: San Jose
                          state: California
                        completed_at: 2023-10-31T23:13:21.647Z
                        plan_mode: manual
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Routes
      description: >-
        Retrieve routes based on the filter parameters provided


        ### Planning failure reasons


        When an order is left unplanned by automated planning,
        `planning_failure_reason` may contain one of these values:


        - `No Worker was available for this plan.`

        - `No Worker schedule overlaps with this order's time window.`

        - `This order is outside the available Worker working hours.`

        - `Worker location is unavailable, so travel time could not be
        evaluated.`

        - `Worker start location is unavailable for the configured route start
        setting.`

        - `No Worker supports the required product type for this order.`

        - `Route was being modified concurrently and this order needs to be
        re-planned.`

        - `The optimizer dropped this order to satisfy planning constraints for
        the overall plan.`

        - `The optimizer could not find a feasible plan for the provided
        constraints.`

        - `Travel time calculation failed for this planning attempt.`

        - `Ops group configuration is incomplete for automated planning.`

        - `Assigning this order would exceed route or Worker capacity.`

        - `No Worker can reach this order before scheduled_at.`

        - `Assigning this order would delay an already planned downstream
        order.`

        - `Assigning this order would exceed the Worker's shift end time.`

        - `Automated planning could not assign this order with the provided
        constraints.`
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateManualRouteResponse"
              example:
                route_handle: route-1
                ops_group_handle: SAN_JOSE_WH
                plan_mode: manual
                status: planned
                version: 1
                estimate:
                  start_by: 2023-03-14T23:20:00Z
                  distance: 1000
                  duration: 600
                  polyline:
                    type: LineString
                    coordinates:
                      - - 77.72123
                        - 12.89617
                      - - 77.72169
                        - 12.89595
                      - - 77.72214
                        - 12.89572
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8924515
                      - 37.4124516
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8984515
                      - 37.5124516
                orders:
                  - order_handle: order_handle_1
                    fulfillment_attempt: 1
                    status: planned
                    ops_group_handle: SAN_JOSE_WH
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-14T23:50:00Z
                    scheduled_after: 2023-03-14T23:20:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: Fremont
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8984515
                          - 37.5124516
                      radius: 50
                      address: Mission Peak, Fremont CA 94539
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    capacity_used: 5
                  - order_handle: order_handle_2
                    fulfillment_attempt: 1
                    status: planned
                    ops_group_handle: SAN_JOSE_WH
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-15T01:30:00Z
                    scheduled_after: 2023-03-15T01:00:00Z
                    metadata:
                      customerId: "1224244"
                    region:
                      city: San Francisco
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -122.3779263
                          - 37.7320465
                      radius: 50
                      address: 888 Innes Ave, San Francisco, CA 94124
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    capacity_used: 5
                embed_url: https://embed.hypertrack.com/dkdkddnd
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Create Route
      description: This API is used to plan a set of unplanned orders into a route
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateManualRouteRequest"
            example:
              track_mode: on_time
              ops_group_handle: SAN_JOSE_WH
              orders:
                - order_handle: order_handle_1
                - order_handle: order_handle_2
              optimise: true
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/locate:
    get:
      parameters:
        - in: query
          name: request_id
          description: Unique identifier returned by POST /workers/{worker_handle}/locate.
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LocateResponse"
              examples:
                locate_completed_location_response_example:
                  summary: "Completed: a device returned a fresh location."
                  value:
                    request_id: 00000000-aaaa-bbbb-cccc-111122223333
                    worker_handle: worker001
                    status: completed
                    created_at: 2026-06-03T05:46:57.096Z
                    updated_at: 2026-06-03T05:47:10.780Z
                    completed_at: 2026-06-03T05:47:10.780Z
                    devices:
                      - device_id: AAA11111-BBBB-2222-CCCC-3333DDDD4444
                        status: completed
                        completed_at: 2026-06-03T05:47:10.744Z
                        location:
                          geometry:
                            type: Point
                            coordinates:
                              - -119.60121
                              - 34.4225
                locate_completed_outage_response_example:
                  summary: "Completed with an outage: location permission denied and imprecise."
                  value:
                    request_id: 00000000-aaaa-bbbb-cccc-111122223333
                    worker_handle: worker001
                    status: completed
                    created_at: 2026-06-03T05:16:03.109Z
                    updated_at: 2026-06-03T05:16:17.146Z
                    completed_at: 2026-06-03T05:16:17.146Z
                    devices:
                      - device_id: AAA11111-BBBB-2222-CCCC-3333DDDD4444
                        status: completed
                        completed_at: 2026-06-03T05:16:17.114Z
                        outage_reasons:
                          - code: location_permissions_denied
                            label: Location permission denied
                            category: behavioural
                            description: Location permission is denied by the worker. The worker should
                              grant it in Settings > Apps > [App name] >
                              Permissions > Location
                            duration: 0
                            distance: 0
                          - code: location_permission_imprecise
                            label: Location imprecise
                            category: behavioural
                            description: The worker did not grant precise location permissions or downgraded
                              permissions to imprecise. The worker should grant
                              precise location permission in Settings > Apps >
                              [App name] > Permissions > Location > Use precise
                              location
                            duration: 0
                            distance: 0
                locate_completed_disconnected_response_example:
                  summary: Completed but the SDK did not wake within budget (device disconnected).
                  value:
                    request_id: 00000000-aaaa-bbbb-cccc-111122223333
                    worker_handle: worker001
                    status: completed
                    created_at: 2026-06-03T00:00:00.000Z
                    updated_at: 2026-06-03T00:05:00.000Z
                    completed_at: 2026-06-03T00:05:00.000Z
                    devices:
                      - device_id: AAA11111-BBBB-2222-CCCC-3333DDDD4444
                        status: completed
                        completed_at: 2026-06-03T00:05:00.000Z
                        device_status:
                          value: disconnected
                          data:
                            reason: sdk_did_not_respond_within_budget
                            budget_seconds: 300
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Poll the state of a worker locate request
      description: "Returns the current state of a locate request. The response shape
        matches both the POST response and the `locate` webhook payload. Once
        `status` is `completed`, inspect each `devices[]` entry for its outcome:
        a fresh `location`, `outage_reasons` when the SDK reported outages, or a
        `device_status` of `disconnected` when the SDK did not wake within the
        budget."
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/export:
    post:
      parameters: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WorkerExportResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
        - WorkerExport
      summary: Create a worker export job
      description: Creates an asynchronous job to export workers to CSV.gz file.
        Returns a job_id that can be used to check status. Download link will be
        sent via email when ready.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/WorkerExportRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/estimate:
    get:
      parameters:
        - in: query
          name: ops_group_handle
          description: Unique Handle of Ops Group to estimate route for
          schema:
            type: string
            minLength: 1
          required: true
        - in: query
          name: orders
          description: 'List of Orders in the desired sequence to do the estimate, it
            should be list of json object, eg: [{"order_handle":
            "<order_handle>", "type":"<pick/drop>", "type_index": 0}] where
            order_handle is a required field'
          schema:
            type: string
            minLength: 1
          required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EstimateRouteResponse"
              example: {}
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Estimate Route
      description: Get the estimate route information for a sequence of orders
      security:
        - BasicAuth: []
        - TokenAuth: []
  /visits/{visit_id}:
    get:
      parameters:
        - in: path
          name: visit_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Visit"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Visits
      summary: Get Visit by id
      description: Retrieve Visit associated with visit_id. This API provides the
        ability to fetch visit based on visit_id
      security:
        - BasicAuth: []
        - TokenAuth: []
    patch:
      parameters:
        - in: path
          name: visit_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PatchVisitResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Visits
      summary: Patch Visits
      description: Update visit.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchVisitRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/ops-groups/:
    get:
      parameters:
        - in: query
          name: pagination_token
          description: Identifier used to fetch the next page of data
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: include_deleted
          description: Flag to include deleted ops groups
          schema:
            type: boolean
            default: false
          required: false
        - in: query
          name: include_schedule
          description: Flag to include ops group's schedule in the response.
          schema:
            type: boolean
            default: true
          required: false
        - in: query
          name: limit
          description: Number of ops groups to be sent in the response.
          schema:
            type: integer
            default: 100
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetOpsGroupsResponse"
              example:
                ops_groups:
                  - ops_group_handle: san-jose-store
                    ops_group_label: store
                    timezone: America/Los_Angeles
                    route_start_location: ops_group_home
                    route_completion_type: manual
                    ops_group_home:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.94186
                          - 37.3570534
                      address: 1709 Automation Pkwy, San Jose, CA 95101
                    objective_fn: minimise_time
                    route_capacity: 10
                    route_max_distance: 20000
                    default_shift_start_time: 07:00
                    default_shift_end_time: 19:00
                    order_tracking_mode: auto
                    shift_availability_mode: auto
                    order_tracking_automation:
                      type: manual
                  - ops_group_handle: santa-clara-store
                    ops_group_label: store
                    timezone: America/Los_Angeles
                    route_start_location: ops_group_home
                    route_completion_type: manual
                    ops_group_home:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8871193
                          - 37.3906152
                      address: 1601 Coleman Ave, Santa Clara, CA 95050
                    objective_fn: minimise_time
                    route_capacity: 10
                    route_max_distance: 25000
                    default_shift_start_time: 07:00
                    default_shift_end_time: 19:00
                    order_tracking_mode: manual
                    shift_availability_mode: manual
                    order_tracking_automation:
                      type: manual
                pagination_token: cGFnaW5hdGlvbl90b2tlbg==
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: List Ops Groups
      description: Fetch all ops groups
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PostOpsGroupResponse"
              example:
                ops_group_handle: san-jose-store
                ops_group_label: store
                timezone: America/Los_Angeles
                route_start_location: ops_group_home
                route_completion_type: manual
                ops_group_home:
                  geometry:
                    type: Point
                    coordinates:
                      - -121.93186
                      - 36.3570534
                  address: 1709 Automation Pkwy, San Jose, CA 95101
                objective_fn: minimise_time
                route_capacity: 10
                route_max_distance: 20000
                default_shift_start_time: 07:00
                default_shift_end_time: 19:00
                order_tracking_mode: manual
                shift_availability_mode: auto
                order_tracking_automation:
                  type: shift
                  mode: auto
                  lead_time: 3600
                  lag_time: 0
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Create Ops Group
      description: Create an ops group to manage your workforce and orders
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PostOpsGroupRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}:
    get:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: fulfillment_attempt
          description: Number identifying the attempt count for the order
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: on_shift_only
          description: Flag to fetch only data related to on-shift.
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: from_time
          description: ISO 8601 datetime indicating the start time to be used for fetching
            order timeline
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: to_time
          description: ISO 8601 datetime indicating the end time to be used for fetching
            order timeline
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: allow_mocked_events
          description: Flag to allow mocked events in the response
          schema:
            type: boolean
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetOrderTimelineResponse"
              example:
                order_handle: order-1
                fulfillment_attempt: 0
                status: completed
                destination:
                  geometry:
                    type: Point
                    coordinates:
                      - -118.311286
                      - 34.0696579
                  address: "250 S St Andrews Pl,  Los Angeles, CA 90004,US "
                  radius: 100
                ops_group_handle: store-la
                track_mode: on_time
                plan_mode: scheduled
                risk_status: true
                risks:
                  moving_away_from_destination: red
                  is_offline: green
                  delayed_from_scheduled_at: green
                  deviating_from_expected_route: yellow
                  in_outage: green
                  moving_too_slow: green
                  delayed_from_initial_eta: green
                  in_low_battery: green
                scheduled_at: 2023-10-24T03:00:00.000Z
                started_at: 2023-10-23T21:30:46.980Z
                arrived_at: 2023-10-23T21:53:05.585Z
                type: drop
                type_index: 0
                expected_service_time: 0
                actual_service_time: 10119
                tracked_service_time: 9998
                capacity_used: 1
                metadata:
                  cancellation_options:
                    - Cancelled order
                    - Other
                  reschedule_options:
                    - No access/gate code
                    - Customer not responsive
                    - Other
                  completion_options:
                    - Handed to customer
                  vendorName: Macys
                  customerName: John
                region:
                  country: United States
                  city: Los Angeles
                  state: California
                share_url: https://trck.at/3ir0a9j6nX
                completed_at: 2023-10-23T23:21:04.653Z
                device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                worker_handle: james@ht.com
                created_at: 2023-10-23T19:09:27.904Z
                assigned_at: 2023-10-23T19:25:15.604Z
                route_handle: 8c167253-3a4f-4f3c-95a4-4192a22f55d4
                plan_id: c3309b8f-759c-4dbb-94tf-d3b09ee5hfa7
                distance: 5295
                duration: 1432
                tracking_rate: 0.99
                polyline:
                  type: LineString
                  coordinates:
                    - - -118.35453
                      - 34.063622
                      - 21.9
                      - 2023-10-23T22:58:24.730Z
                    - - -118.35453
                      - 34.063622
                      - 21.9
                      - 2023-10-23T22:58:39.796Z
                    - - -118.354519
                      - 34.063603
                      - 22.1
                      - 2023-10-23T22:58:43.028Z
                    - - -118.354519
                      - 34.063603
                      - 22.1
                      - 2023-10-23T22:58:48.250Z
                    - - -118.354518
                      - 34.063605
                      - 22.1
                      - 2023-10-23T22:58:48.251Z
                    - - -118.354635
                      - 34.06361
                      - 22.1
                      - 2023-10-23T22:58:48.407Z
                    - - -118.354635
                      - 34.06361
                      - 22.1
                      - 2023-10-23T22:59:08.931Z
                    - - -118.35464
                      - 34.06361
                      - 22.1
                      - 2023-10-23T22:59:08.931Z
                    - - -118.354635
                      - 34.06362
                      - 22.1
                      - 2023-10-23T22:59:08.932Z
                    - - -118.354646
                      - 34.064719
                      - 22.1
                      - 2023-10-23T22:59:12.048Z
                    - - -118.354646
                      - 34.064719
                      - 22.1
                      - 2023-10-23T22:59:14.189Z
                    - - -118.354572
                      - 34.064717
                      - 22.1
                      - 2023-10-23T22:59:14.190Z
                    - - -118.354647
                      - 34.064739
                      - 22.1
                      - 2023-10-23T22:59:14.229Z
                    - - -118.354649
                      - 34.064749
                      - 22.1
                      - 2023-10-23T22:59:24.259Z
                    - - -118.354649
                      - 34.064749
                      - 22.1
                      - 2023-10-23T22:59:26.583Z
                    - - -118.35459
                      - 34.064765
                      - 22.1
                      - 2023-10-23T22:59:26.584Z
                    - - -118.354654
                      - 34.064769
                      - 22.1
                      - 2023-10-23T22:59:26.705Z
                    - - -118.354658
                      - 34.064785
                      - 22.1
                      - 2023-10-23T22:59:36.749Z
                    - - -118.35468
                      - 34.06488
                      - 22.1
                      - 2023-10-23T22:59:37.740Z
                    - - -118.3545
                      - 34.064883
                      - 22.1
                      - 2023-10-23T22:59:39.030Z
                    - - -118.35436
                      - 34.064882
                      - 22.1
                      - 2023-10-23T22:59:41.050Z
                    - - -118.35414
                      - 34.064882
                      - 23.75
                      - 2023-10-23T22:59:43.040Z
                    - - -118.35388
                      - 34.064882
                      - 25.28
                      - 2023-10-23T22:59:45.028Z
                    - - -118.3536
                      - 34.064882
                      - 26.29
                      - 2023-10-23T22:59:47.030Z
                    - - -118.3536
                      - 34.064882
                      - 26.29
                      - 2023-10-23T22:59:48.546Z
                    - - -118.35312
                      - 34.064882
                      - 29.1
                      - 2023-10-23T22:59:50.768Z
                    - - -118.35238
                      - 34.064877
                      - 29.1
                      - 2023-10-23T22:59:55.023Z
                    - - -118.35172
                      - 34.064884
                      - 26.2
                      - 2023-10-23T23:00:01.030Z
                    - - -118.35172
                      - 34.064884
                      - 26.2
                      - 2023-10-23T23:00:11.948Z
                    - - -118.3517
                      - 34.064884
                      - 25.11
                      - 2023-10-23T23:00:11.949Z
                    - - -118.35169
                      - 34.064884
                      - 25.11
                      - 2023-10-23T23:00:12.067Z
                    - - -118.35169
                      - 34.064887
                      - 25.11
                      - 2023-10-23T23:00:32.139Z
                    - - -118.351659
                      - 34.064887
                      - 25.11
                      - 2023-10-23T23:00:32.140Z
                    - - -118.35117
                      - 34.064885
                      - 29.1
                      - 2023-10-23T23:00:35.044Z
                    - - -118.35076
                      - 34.064884
                      - 29.1
                      - 2023-10-23T23:00:38.036Z
                    - - -118.350489
                      - 34.064887
                      - 29.1
                      - 2023-10-23T23:00:40.039Z
                    - - -118.350489
                      - 34.064887
                      - 29.1
                      - 2023-10-23T23:00:40.281Z
                    - - -118.35029
                      - 34.064885
                      - 29.1
                      - 2023-10-23T23:00:41.479Z
                    - - -118.34963
                      - 34.06489
                      - 29.1
                      - 2023-10-23T23:00:46.038Z
                    - - -118.34901
                      - 34.064891
                      - 31.09
                      - 2023-10-23T23:00:50.041Z
                    - - -118.34841
                      - 34.064888
                      - 31.73
                      - 2023-10-23T23:00:54.020Z
                    - - -118.34777
                      - 34.064892
                      - 32.81
                      - 2023-10-23T23:00:58.029Z
                    - - -118.34743
                      - 34.064894
                      - 29.1
                      - 2023-10-23T23:01:11.609Z
                    - - -118.347427
                      - 34.06489
                      - 29.1
                      - 2023-10-23T23:01:17.449Z
                    - - -118.347426
                      - 34.064892
                      - 29.1
                      - 2023-10-23T23:01:17.450Z
                    - - -118.34743
                      - 34.064894
                      - 29.1
                      - 2023-10-23T23:01:17.594Z
                    - - -118.347426
                      - 34.064892
                      - 29.1
                      - 2023-10-23T23:01:36.601Z
                    - - -118.347423
                      - 34.064895
                      - 29.1
                      - 2023-10-23T23:01:36.602Z
                    - - -118.347236
                      - 34.064896
                      - 26.7
                      - 2023-10-23T23:01:40.036Z
                    - - -118.347409
                      - 34.064888
                      - 26.7
                      - 2023-10-23T23:01:43.175Z
                    - - -118.347417
                      - 34.064895
                      - 26.7
                      - 2023-10-23T23:01:43.176Z
                    - - -118.347236
                      - 34.06494
                      - 26.7
                      - 2023-10-23T23:01:45.416Z
                    - - -118.347234
                      - 34.06539
                      - 26.7
                      - 2023-10-23T23:01:54.040Z
                    - - -118.347236
                      - 34.06599
                      - 29.1
                      - 2023-10-23T23:02:02.027Z
                    - - -118.347241
                      - 34.06658
                      - 29.1
                      - 2023-10-23T23:02:08.044Z
                    - - -118.347244
                      - 34.06712
                      - 29.64
                      - 2023-10-23T23:02:22.045Z
                    - - -118.347244
                      - 34.06778
                      - 33.41
                      - 2023-10-23T23:02:28.036Z
                    - - -118.347245
                      - 34.06826
                      - 32.93
                      - 2023-10-23T23:02:32.061Z
                    - - -118.347243
                      - 34.06882
                      - 32.2
                      - 2023-10-23T23:02:38.032Z
                    - - -118.34724
                      - 34.06918
                      - 32.2
                      - 2023-10-23T23:02:42.591Z
                    - - -118.346557
                      - 34.069061
                      - 34.65
                      - 2023-10-23T23:02:50.039Z
                    - - -118.345868
                      - 34.068937
                      - 34.05
                      - 2023-10-23T23:02:56.173Z
                    - - -118.345389
                      - 34.068888
                      - 31.6
                      - 2023-10-23T23:03:14.062Z
                    - - -118.34521
                      - 34.068889
                      - 31.6
                      - 2023-10-23T23:03:29.090Z
                    - - -118.34464
                      - 34.068894
                      - 34.17
                      - 2023-10-23T23:03:34.041Z
                    - - -118.34401
                      - 34.0689
                      - 34.09
                      - 2023-10-23T23:03:40.027Z
                    - - -118.34331
                      - 34.0689
                      - 35.43
                      - 2023-10-23T23:03:46.046Z
                    - - -118.34276
                      - 34.068896
                      - 36.75
                      - 2023-10-23T23:03:50.034Z
                    - - -118.34213
                      - 34.068898
                      - 37.27
                      - 2023-10-23T23:03:54.021Z
                    - - -118.34146
                      - 34.068899
                      - 36.99
                      - 2023-10-23T23:03:58.045Z
                    - - -118.34084
                      - 34.068901
                      - 37.53
                      - 2023-10-23T23:04:02.049Z
                    - - -118.34029
                      - 34.068902
                      - 37.36
                      - 2023-10-23T23:04:06.046Z
                    - - -118.33943
                      - 34.06891
                      - 38.74
                      - 2023-10-23T23:04:13.041Z
                    - - -118.338801
                      - 34.068916
                      - 37.16
                      - 2023-10-23T23:04:19.028Z
                    - - -118.338831
                      - 34.068916
                      - 36.4
                      - 2023-10-23T23:04:29.345Z
                    - - -118.338831
                      - 34.068916
                      - 36.4
                      - 2023-10-23T23:04:44.392Z
                    - - -118.338826
                      - 34.06887
                      - 36.4
                      - 2023-10-23T23:04:46.287Z
                    - - -118.338826
                      - 34.06887
                      - 36.4
                      - 2023-10-23T23:04:46.288Z
                    - - -118.338831
                      - 34.068916
                      - 36.4
                      - 2023-10-23T23:04:46.317Z
                    - - -118.338826
                      - 34.06887
                      - 36.4
                      - 2023-10-23T23:05:06.529Z
                    - - -118.338826
                      - 34.06887
                      - 36.4
                      - 2023-10-23T23:05:06.530Z
                    - - -118.33807
                      - 34.068919
                      - 40.11
                      - 2023-10-23T23:05:09.022Z
                    - - -118.33735
                      - 34.068923
                      - 41.26
                      - 2023-10-23T23:05:14.020Z
                    - - -118.33664
                      - 34.068924
                      - 42.12
                      - 2023-10-23T23:05:18.038Z
                    - - -118.335941
                      - 34.068928
                      - 42.23
                      - 2023-10-23T23:05:22.018Z
                    - - -118.33519
                      - 34.068931
                      - 42.13
                      - 2023-10-23T23:05:26.039Z
                    - - -118.33441
                      - 34.06893
                      - 43.46
                      - 2023-10-23T23:05:30.034Z
                    - - -118.333631
                      - 34.068932
                      - 42.05
                      - 2023-10-23T23:05:34.038Z
                    - - -118.33284
                      - 34.06893
                      - 42.08
                      - 2023-10-23T23:05:38.038Z
                    - - -118.33206
                      - 34.068929
                      - 41.81
                      - 2023-10-23T23:05:42.041Z
                    - - -118.33124
                      - 34.068931
                      - 42.51
                      - 2023-10-23T23:05:46.021Z
                    - - -118.33043
                      - 34.068934
                      - 43.69
                      - 2023-10-23T23:05:50.019Z
                    - - -118.32974
                      - 34.068933
                      - 43.81
                      - 2023-10-23T23:05:54.036Z
                    - - -118.32915
                      - 34.068933
                      - 38.44
                      - 2023-10-23T23:06:02.027Z
                    - - -118.32902
                      - 34.068934
                      - 36.7
                      - 2023-10-23T23:06:12.534Z
                    - - -118.328371
                      - 34.068941
                      - 36.7
                      - 2023-10-23T23:06:24.026Z
                    - - -118.32808
                      - 34.068943
                      - 36.7
                      - 2023-10-23T23:06:38.569Z
                    - - -118.32808
                      - 34.068943
                      - 36.7
                      - 2023-10-23T23:06:43.347Z
                    - - -118.32807
                      - 34.068943
                      - 36.8
                      - 2023-10-23T23:06:43.348Z
                    - - -118.32804
                      - 34.068944
                      - 36.8
                      - 2023-10-23T23:06:45.577Z
                    - - -118.32804
                      - 34.068944
                      - 36.8
                      - 2023-10-23T23:06:53.355Z
                    - - -118.328039
                      - 34.068918
                      - 36.8
                      - 2023-10-23T23:06:53.356Z
                    - - -118.32804
                      - 34.068944
                      - 36.8
                      - 2023-10-23T23:06:53.372Z
                    - - -118.32804
                      - 34.068944
                      - 36.8
                      - 2023-10-23T23:07:04.773Z
                    - - -118.32804
                      - 34.06894
                      - 36.8
                      - 2023-10-23T23:07:04.773Z
                    - - -118.32804
                      - 34.068944
                      - 36.8
                      - 2023-10-23T23:07:04.774Z
                    - - -118.32655
                      - 34.068954
                      - 37
                      - 2023-10-23T23:07:19.179Z
                    - - -118.32628
                      - 34.068954
                      - 37
                      - 2023-10-23T23:07:29.693Z
                    - - -118.32621
                      - 34.068954
                      - 37
                      - 2023-10-23T23:07:44.737Z
                    - - -118.325541
                      - 34.068956
                      - 37
                      - 2023-10-23T23:07:54.036Z
                    - - -118.32498
                      - 34.068962
                      - 38.8
                      - 2023-10-23T23:07:58.023Z
                    - - -118.324331
                      - 34.06896
                      - 39.61
                      - 2023-10-23T23:08:02.040Z
                    - - -118.32369
                      - 34.068958
                      - 37
                      - 2023-10-23T23:08:06.022Z
                    - - -118.323079
                      - 34.068949
                      - 40.22
                      - 2023-10-23T23:08:10.051Z
                    - - -118.322291
                      - 34.068956
                      - 43.73
                      - 2023-10-23T23:08:14.023Z
                    - - -118.32147
                      - 34.068966
                      - 44.87
                      - 2023-10-23T23:08:18.039Z
                    - - -118.32061
                      - 34.068961
                      - 46.39
                      - 2023-10-23T23:08:22.023Z
                    - - -118.31984
                      - 34.068959
                      - 44.43
                      - 2023-10-23T23:08:26.039Z
                    - - -118.31927
                      - 34.068962
                      - 40.9
                      - 2023-10-23T23:08:30.037Z
                    - - -118.31866
                      - 34.068966
                      - 36.1
                      - 2023-10-23T23:08:42.038Z
                    - - -118.31796
                      - 34.068966
                      - 36.1
                      - 2023-10-23T23:08:48.056Z
                    - - -118.31726
                      - 34.068966
                      - 36.1
                      - 2023-10-23T23:08:54.042Z
                    - - -118.31663
                      - 34.068968
                      - 33.51
                      - 2023-10-23T23:09:04.060Z
                    - - -118.31609
                      - 34.068966
                      - 34.06
                      - 2023-10-23T23:09:10.044Z
                    - - -118.31549
                      - 34.068968
                      - 33.18
                      - 2023-10-23T23:09:19.056Z
                    - - -118.315489
                      - 34.068947
                      - 33.18
                      - 2023-10-23T23:09:19.056Z
                    - - -118.315387
                      - 34.068944
                      - 32.94
                      - 2023-10-23T23:09:35.126Z
                    - - -118.315387
                      - 34.068944
                      - 32.94
                      - 2023-10-23T23:09:39.199Z
                    - - -118.315388
                      - 34.068944
                      - 32.86
                      - 2023-10-23T23:09:39.200Z
                    - - -118.315389
                      - 34.068943
                      - 32.86
                      - 2023-10-23T23:09:39.299Z
                    - - -118.315389
                      - 34.068943
                      - 32.86
                      - 2023-10-23T23:09:57.640Z
                    - - -118.315394
                      - 34.068938
                      - 34.8
                      - 2023-10-23T23:09:57.641Z
                    - - -118.315387
                      - 34.068939
                      - 34.8
                      - 2023-10-23T23:09:58.030Z
                    - - -118.315328
                      - 34.068956
                      - 33.1
                      - 2023-10-23T23:10:08.049Z
                    - - -118.3147
                      - 34.068969
                      - 33.1
                      - 2023-10-23T23:10:17.047Z
                    - - -118.3147
                      - 34.068969
                      - 33.1
                      - 2023-10-23T23:10:30.185Z
                    - - -118.31448
                      - 34.068973
                      - 33.1
                      - 2023-10-23T23:10:30.186Z
                    - - -118.31448
                      - 34.068973
                      - 33.1
                      - 2023-10-23T23:10:31.049Z
                    - - -118.31448
                      - 34.068973
                      - 33.1
                      - 2023-10-23T23:10:38.555Z
                    - - -118.31448
                      - 34.06897
                      - 33.1
                      - 2023-10-23T23:10:38.555Z
                    - - -118.314482
                      - 34.068959
                      - 33.1
                      - 2023-10-23T23:10:38.556Z
                    - - -118.31448
                      - 34.068973
                      - 33.1
                      - 2023-10-23T23:10:38.675Z
                    - - -118.31448
                      - 34.068973
                      - 33.1
                      - 2023-10-23T23:11:29.146Z
                    - - -118.31448
                      - 34.06897
                      - 33.1
                      - 2023-10-23T23:11:29.146Z
                    - - -118.31448
                      - 34.068973
                      - 32.6
                      - 2023-10-23T23:11:29.147Z
                    - - -118.3139
                      - 34.068972
                      - 34.8
                      - 2023-10-23T23:11:31.337Z
                    - - -118.31315
                      - 34.068979
                      - 34.8
                      - 2023-10-23T23:11:36.044Z
                    - - -118.31249
                      - 34.068982
                      - 34.8
                      - 2023-10-23T23:11:40.025Z
                    - - -118.31178
                      - 34.068976
                      - 34.8
                      - 2023-10-23T23:11:46.040Z
                    - - -118.31115
                      - 34.068965
                      - 36.77
                      - 2023-10-23T23:11:52.037Z
                    - - -118.31059
                      - 34.068961
                      - 34.8
                      - 2023-10-23T23:12:00.048Z
                    - - -118.31038
                      - 34.06896
                      - 34.8
                      - 2023-10-23T23:12:04.849Z
                    - - -118.310385
                      - 34.06921
                      - 35.9
                      - 2023-10-23T23:12:11.532Z
                    - - -118.310388
                      - 34.06985
                      - 38.59
                      - 2023-10-23T23:12:16.044Z
                    - - -118.310391
                      - 34.07044
                      - 39.11
                      - 2023-10-23T23:12:22.032Z
                    - - -118.310394
                      - 34.07098
                      - 39.52
                      - 2023-10-23T23:12:28.041Z
                    - - -118.3104
                      - 34.07114
                      - 39.52
                      - 2023-10-23T23:12:31.381Z
                    - - -118.31091
                      - 34.071139
                      - 40.5
                      - 2023-10-23T23:12:40.042Z
                    - - -118.31145
                      - 34.071139
                      - 35.9
                      - 2023-10-23T23:12:50.062Z
                    - - -118.31163
                      - 34.07114
                      - 35.9
                      - 2023-10-23T23:12:54.551Z
                    - - -118.311629
                      - 34.07075
                      - 35.9
                      - 2023-10-23T23:13:06.042Z
                    - - -118.311628
                      - 34.07048
                      - 35.9
                      - 2023-10-23T23:13:16.847Z
                    - - -118.311677
                      - 34.06973
                      - 35.7
                      - 2023-10-23T23:13:26.032Z
                    - - -118.311673
                      - 34.069433
                      - 36.2
                      - 2023-10-23T23:13:26.032Z
                    - - -118.311673
                      - 34.069433
                      - 36.2
                      - 2023-10-23T23:16:22.028Z
                    - - -118.311673
                      - 34.069433
                      - 36.2
                      - 2023-10-23T23:16:26.040Z
                    - - -118.311668
                      - 34.069423
                      - 36.2
                      - 2023-10-23T23:16:26.058Z
                    - - -118.311668
                      - 34.069423
                      - 36.2
                      - 2023-10-23T23:16:46.796Z
                    - - -118.31166
                      - 34.069407
                      - 36.2
                      - 2023-10-23T23:16:46.797Z
                    - - -118.311658
                      - 34.069402
                      - 35.7
                      - 2023-10-23T23:16:50.068Z
                    - - -118.311658
                      - 34.069402
                      - 35.7
                      - 2023-10-23T23:16:50.170Z
                    - - -118.311658
                      - 34.069404
                      - 35.7
                      - 2023-10-23T23:16:52.397Z
                    - - -118.311658
                      - 34.069404
                      - 35.7
                      - 2023-10-23T23:16:54.183Z
                    - - -118.311656
                      - 34.069408
                      - 35.7
                      - 2023-10-23T23:16:54.184Z
                    - - -118.311658
                      - 34.069404
                      - 35.7
                      - 2023-10-23T23:16:54.390Z
                    - - -118.311658
                      - 34.069404
                      - 35.7
                      - 2023-10-23T23:17:04.097Z
                    - - -118.311657
                      - 34.069404
                      - 35.7
                      - 2023-10-23T23:17:04.098Z
                    - - -118.311656
                      - 34.069405
                      - 35.7
                      - 2023-10-23T23:17:04.572Z
                    - - -118.311656
                      - 34.069405
                      - 35.7
                      - 2023-10-23T23:17:41.784Z
                    - - -118.311656
                      - 34.069405
                      - 35.7
                      - 2023-10-23T23:17:52.747Z
                    - - -118.311665
                      - 34.069416
                      - 35.7
                      - 2023-10-23T23:17:56.043Z
                    - - -118.311665
                      - 34.069416
                      - 35.7
                      - 2023-10-23T23:17:56.197Z
                    - - -118.311665
                      - 34.069416
                      - 35.7
                      - 2023-10-23T23:17:56.198Z
                    - - -118.311666
                      - 34.069419
                      - 35.7
                      - 2023-10-23T23:17:58.409Z
                    - - -118.311666
                      - 34.069412
                      - 35.7
                      - 2023-10-23T23:18:08.457Z
                    - - -118.311666
                      - 34.069412
                      - 35.7
                      - 2023-10-23T23:18:08.683Z
                    - - -118.311666
                      - 34.069411
                      - 35.7
                      - 2023-10-23T23:18:10.893Z
                    - - -118.311666
                      - 34.069411
                      - 35.7
                      - 2023-10-23T23:18:13.150Z
                    - - -118.311666
                      - 34.069411
                      - 35.7
                      - 2023-10-23T23:18:13.151Z
                    - - -118.311667
                      - 34.069409
                      - 35.7
                      - 2023-10-23T23:18:15.382Z
                    - - -118.311667
                      - 34.069409
                      - 35.7
                      - 2023-10-23T23:18:18.199Z
                    - - -118.311667
                      - 34.069409
                      - 35.7
                      - 2023-10-23T23:18:18.200Z
                    - - -118.311666
                      - 34.06941
                      - 35.7
                      - 2023-10-23T23:18:20.440Z
                    - - -118.311666
                      - 34.06941
                      - 35.7
                      - 2023-10-23T23:19:20.739Z
                    - - -118.311665
                      - 34.069412
                      - 35.7
                      - 2023-10-23T23:19:20.740Z
                    - - -118.311597
                      - 34.069639
                      - 35.7
                      - 2023-10-23T23:19:24.043Z
                    - - -118.311597
                      - 34.069639
                      - 35.7
                      - 2023-10-23T23:19:24.211Z
                    - - -118.311597
                      - 34.069639
                      - 35.7
                      - 2023-10-23T23:19:24.212Z
                    - - -118.311612
                      - 34.069586
                      - 35.7
                      - 2023-10-23T23:19:27.042Z
                    - - -118.311576
                      - 34.069543
                      - 35.7
                      - 2023-10-23T23:19:37.085Z
                    - - -118.311576
                      - 34.069543
                      - 35.7
                      - 2023-10-23T23:19:39.643Z
                    - - -118.31157
                      - 34.069545
                      - 35.7
                      - 2023-10-23T23:19:39.644Z
                    - - -118.311569
                      - 34.069546
                      - 35.7
                      - 2023-10-23T23:19:39.778Z
                    - - -118.311569
                      - 34.069546
                      - 35.7
                      - 2023-10-23T23:19:52.454Z
                    - - -118.311572
                      - 34.06961
                      - 35.7
                      - 2023-10-23T23:19:52.455Z
                    - - -118.311571
                      - 34.069622
                      - 35.7
                      - 2023-10-23T23:19:54.673Z
                    - - -118.311548
                      - 34.069634
                      - 35.7
                      - 2023-10-23T23:20:04.701Z
                    - - -118.311548
                      - 34.069634
                      - 35.7
                      - 2023-10-23T23:20:05.251Z
                    - - -118.311549
                      - 34.069635
                      - 35.7
                      - 2023-10-23T23:20:05.252Z
                    - - -118.31155
                      - 34.069636
                      - 35.7
                      - 2023-10-23T23:20:05.471Z
                    - - -118.31155
                      - 34.069636
                      - 35.7
                      - 2023-10-23T23:20:20.389Z
                    - - -118.311554
                      - 34.069639
                      - 35.7
                      - 2023-10-23T23:20:20.390Z
                    - - -118.311567
                      - 34.070041
                      - 36
                      - 2023-10-23T23:20:24.033Z
                    - - -118.311607
                      - 34.070519
                      - 36
                      - 2023-10-23T23:20:29.034Z
                    - - -118.311585
                      - 34.070816
                      - 36
                      - 2023-10-23T23:20:31.031Z
                    - - -118.311593
                      - 34.070936
                      - 36
                      - 2023-10-23T23:20:33.028Z
                    - - -118.311607
                      - 34.071022
                      - 36
                      - 2023-10-23T23:20:44.135Z
                    - - -118.311607
                      - 34.071022
                      - 36
                      - 2023-10-23T23:20:48.914Z
                    - - -118.31161
                      - 34.071031
                      - 36
                      - 2023-10-23T23:20:48.915Z
                    - - -118.311613
                      - 34.071039
                      - 37.5
                      - 2023-10-23T23:20:51.178Z
                start_location:
                  type: Point
                  coordinates:
                    - -118.35453
                    - 34.063622
                end_location:
                  type: Point
                  coordinates:
                    - -118.311613
                    - 34.071039
                visited_destination: true
                completed_at_destination: false
                deviation_from_destination: 156
                checkin:
                  - geometry:
                      type: Point
                      coordinates:
                        - -118.35453
                        - 34.063622
                    score: 1
                    timestamp: 2023-10-23T22:58:24.730Z
                  - geometry:
                      type: Point
                      coordinates:
                        - -118.311677
                        - 34.06973
                    score: 1
                    timestamp: 2023-10-23T23:13:26.032Z
                service_area:
                  - geometry:
                      type: Polygon
                      coordinates:
                        - - - -118.35432319371859
                            - 34.063418626669126
                          - - -118.35423026516654
                            - 34.06348949068416
                          - - -118.35425579272142
                            - 34.06359003560771
                          - - -118.35416286395404
                            - 34.06366089955227
                          - - -118.3541883914956
                            - 34.06376144439763
                          - - -118.35430684795999
                            - 34.063791125230274
                          - - -118.35433237564362
                            - 34.06389166992927
                          - - -118.35445083220353
                            - 34.063921350555056
                          - - -118.35454376087782
                            - 34.063850486489535
                          - - -118.35466221733132
                            - 34.06388016691616
                          - - -118.35475514574374
                            - 34.063809302719655
                          - - -118.35472961774923
                            - 34.063708758157034
                          - - -118.3548225459463
                            - 34.06363789389004
                          - - -118.35479701793845
                            - 34.06353734924923
                          - - -118.35467856188895
                            - 34.063507668807205
                          - - -118.35465303402317
                            - 34.063407124020024
                          - - -118.3545345780692
                            - 34.063377443371145
                          - - -118.35444164977902
                            - 34.06344830751716
                          - - -118.35432319371859
                            - 34.063418626669126
                    time_spent: 23
                  - geometry:
                      type: Polygon
                      coordinates:
                        - - - -118.31135953961919
                            - 34.069406617863066
                          - - -118.3112665598661
                            - 34.06947745565891
                          - - -118.31129205526649
                            - 34.06957801591689
                          - - -118.31119907529805
                            - 34.06964885364192
                          - - -118.31122457068491
                            - 34.06974941382162
                          - - -118.31134304619592
                            - 34.06977913620829
                          - - -118.31136854172493
                            - 34.06987969624172
                          - - -118.31148701733193
                            - 34.069909418421624
                          - - -118.31157999720804
                            - 34.06983858057556
                          - - -118.31169847270921
                            - 34.06986830255615
                          - - -118.31179145232383
                            - 34.06979746457877
                          - - -118.31176595648346
                            - 34.06969690468131
                          - - -118.3118589358827
                            - 34.06962606663312
                          - - -118.31183344002879
                            - 34.069525506657364
                          - - -118.31192641921268
                            - 34.06945466853837
                          - - -118.31190092334528
                            - 34.06935410848435
                          - - -118.31178244844959
                            - 34.06932438648134
                          - - -118.31175695272435
                            - 34.06922382628105
                          - - -118.31163847792467
                            - 34.06919410407128
                          - - -118.31154549864847
                            - 34.069264942069246
                          - - -118.31142702374301
                            - 34.06923521966017
                          - - -118.31133404420525
                            - 34.06930605752684
                          - - -118.31135953961919
                            - 34.069406617863066
                    time_spent: 418
                  - geometry:
                      type: Polygon
                      coordinates:
                        - - - -118.31153051867214
                            - 34.07095613013976
                          - - -118.31143753781154
                            - 34.07102696775276
                          - - -118.31146303369948
                            - 34.07112752695597
                          - - -118.31158151060372
                            - 34.071157248478194
                          - - -118.31167449141816
                            - 34.07108641080468
                          - - -118.31164899537453
                            - 34.07098585166944
                          - - -118.31174197597362
                            - 34.07091501392512
                          - - -118.31171647991647
                            - 34.070814454711595
                          - - -118.31159800341594
                            - 34.07078473317442
                          - - -118.31150502277067
                            - 34.07085557085826
                          - - -118.31153051867214
                            - 34.07095613013976
                    time_spent: 20
                  - geometry:
                      type: Polygon
                      coordinates:
                        - - - -118.31537711417998
                            - 34.06862536634444
                          - - -118.31528413939579
                            - 34.06869620663504
                          - - -118.31516566619378
                            - 34.068666487820714
                          - - -118.31507269114803
                            - 34.068737327980024
                          - - -118.31509818935052
                            - 34.06883788701418
                          - - -118.31500521408945
                            - 34.06890872710273
                          - - -118.31503071227843
                            - 34.06900928605861
                          - - -118.31514918588415
                            - 34.06903900485796
                          - - -118.31517468421532
                            - 34.06913956366758
                          - - -118.31529315791698
                            - 34.069169282260155
                          - - -118.31538613308572
                            - 34.06909844205061
                          - - -118.31550460668154
                            - 34.06912816044389
                          - - -118.31559758158868
                            - 34.06905732010303
                          - - -118.31557208294623
                            - 34.06895676142941
                          - - -118.31566505763804
                            - 34.068885921017795
                          - - -118.31563955898207
                            - 34.068785362265906
                          - - -118.31552108578995
                            - 34.06875564385763
                          - - -118.31549558727615
                            - 34.068655084959474
                          - - -118.31537711417998
                            - 34.06862536634444
                    time_spent: 48
                parking:
                  - geometry:
                      type: Point
                      coordinates:
                        - -118.315489
                        - 34.068947
                    score: 1
                    timestamp: 2023-10-23T23:09:19.056Z
                  - geometry:
                      type: Point
                      coordinates:
                        - -118.311677
                        - 34.06973
                    score: 1
                    timestamp: 2023-10-23T23:13:26.032Z
                timeline:
                  - type: order_created
                    recorded_at: 2023-10-23T19:09:27.904Z
                    order_handle: order-1
                    metadata:
                      address: "250 S St Andrews Pl,  Los Angeles, CA 90004,US "
                      orderId: "223344"
                      cancellation_options:
                        - Cancelled order
                        - Other
                      reschedule_options:
                        - No access/gate code
                        - Customer not responsive
                        - Other
                      completion_options:
                        - Handed to customer
                      vendorName: Macys
                      customerName: John
                  - type: order_assigned
                    recorded_at: 2023-10-23T19:25:15.604Z
                    order_handle: order-1
                    driver_handle: james@ht.com
                    fulfillment_attempt: 0
                  - type: order_started
                    recorded_at: 2023-10-23T21:30:46.980Z
                    order_handle: order-1
                    route_handle: 8c167253-3a4f-4f3c-95a4-4192a22f55d4
                    order_type: drop
                    fulfillment_attempt: 0
                  - type: driver_activity_started
                    recorded_at: 2023-10-23T22:57:11.631Z
                    driver_handle: null
                    activity: stop
                    location:
                      recorded_at: 2023-10-23T22:58:24.730Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.35453
                          - 34.063622
                    address: One Museum Square, 640, South Curson Avenue, Miracle Mile,
                      Mid-Wilshire, Los Angeles, Los Angeles County, California,
                      90036, United States
                  - type: driver_activity_ended
                    recorded_at: 2023-10-23T22:58:39.796Z
                    driver_handle: null
                    activity: stop
                    location:
                      recorded_at: 2023-10-23T22:58:39.796Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.35453
                          - 34.063622
                    distance: null
                    duration: 88
                    steps: 0
                  - type: driver_activity_started
                    recorded_at: 2023-10-23T22:58:39.796Z
                    driver_handle: null
                    activity: walk
                    location:
                      recorded_at: 2023-10-23T22:58:39.796Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.35453
                          - 34.063622
                    address: null
                  - type: driver_activity_ended
                    recorded_at: 2023-10-23T22:58:48.250Z
                    driver_handle: null
                    activity: walk
                    location:
                      recorded_at: 2023-10-23T22:58:48.250Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.354519
                          - 34.063603
                    distance: null
                    duration: 8
                    steps: 0
                  - type: driver_activity_started
                    recorded_at: 2023-10-23T22:58:48.251Z
                    driver_handle: null
                    activity: drive
                    location:
                      recorded_at: 2023-10-23T22:58:48.251Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.354518
                          - 34.063605
                    address: null
                  - type: order_service_started
                    recorded_at: 2023-10-23T23:09:19.056Z
                    location:
                      recorded_at: 2023-10-23T23:09:19.056Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.315489
                          - 34.068947
                    duration: 727
                    distance: 4323
                    order_handle: order-1
                    order_id: 15e2c782-805a-4404-9b85-82be76dba0e2
                    order_type: drop
                    fulfillment_attempt: 0
                  - type: driver_activity_ended
                    recorded_at: 2023-10-23T23:09:19.056Z
                    driver_handle: null
                    activity: drive
                    location:
                      recorded_at: 2023-10-23T23:09:19.056Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.31549
                          - 34.068968
                    distance: 4323
                    duration: 631
                    steps: null
                  - type: driver_activity_started
                    recorded_at: 2023-10-23T23:09:19.056Z
                    driver_handle: null
                    activity: walk
                    location:
                      recorded_at: 2023-10-23T23:09:19.056Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.315489
                          - 34.068947
                    address: null
                  - type: driver_activity_ended
                    recorded_at: 2023-10-23T23:10:08.049Z
                    driver_handle: null
                    activity: walk
                    location:
                      recorded_at: 2023-10-23T23:10:08.049Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.315328
                          - 34.068956
                    distance: null
                    duration: 49
                    steps: 0
                  - type: driver_activity_started
                    recorded_at: 2023-10-23T23:10:08.049Z
                    driver_handle: null
                    activity: drive
                    location:
                      recorded_at: 2023-10-23T23:10:08.049Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.315328
                          - 34.068956
                    address: null
                  - type: order_geofence_entered
                    recorded_at: 2023-10-23T23:11:44.199Z
                    location:
                      geometry:
                        coordinates:
                          - -118.31199713153354
                          - 34.068977834914364
                          - 0
                        type: Point
                      recorded_at: 2023-10-23T23:11:44.199Z
                    duration: 6059
                    distance: 31348
                    order_handle: order-1
                    order_id: 26c2c782-805a-4404-9b85-82be76dba0e2
                    order_type: drop
                    fulfillment_attempt: 0
                  - type: driver_activity_ended
                    recorded_at: 2023-10-23T23:13:26.032Z
                    driver_handle: null
                    activity: drive
                    location:
                      recorded_at: 2023-10-23T23:13:26.032Z
                      geometry:
                        type: Point
                        coordinates:
                          - -118.311677
                          - 34.06973
                    distance: 972
                    duration: 198
                    steps: null
                  - type: driver_activity_started
                    recorded_at: 2023-10-23T23:13:26.032Z
                    driver_handle: null
                    activity: stop
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -118.311673
                          - 34.069433
                      recorded_at: 2023-10-23T23:13:26.032Z
                    address: South Saint Andrew's Place, Wilton Historic District, Koreatown, Los
                      Angeles, Los Angeles County, California, 90020, United
                      States
                  - type: driver_activity_ended
                    recorded_at: 2023-10-23T23:19:20.739Z
                    driver_handle: null
                    activity: stop
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -118.311666
                          - 34.06941
                      recorded_at: 2023-10-23T23:19:20.739Z
                    distance: null
                    duration: 355
                    steps: 84
                  - type: driver_activity_started
                    recorded_at: 2023-10-23T23:19:20.739Z
                    driver_handle: null
                    activity: walk
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -118.311666
                          - 34.06941
                      recorded_at: 2023-10-23T23:19:20.739Z
                    address: null
                  - type: driver_activity_ended
                    recorded_at: 2023-10-23T23:20:51.178Z
                    driver_handle: null
                    activity: walk
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -118.311613
                          - 34.071039
                      recorded_at: 2023-10-23T23:20:51.178Z
                    distance: null
                    duration: 90
                    steps: 9
                  - type: order_service_ended
                    recorded_at: 2023-10-23T23:20:51.178Z
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -118.311613
                          - 34.071039
                      recorded_at: 2023-10-23T23:20:51.178Z
                    duration: 692
                    distance: 972
                    order_handle: order-1
                    order_id: 26c2c782-805a-4404-9b85-82be76dba0e2
                    order_type: drop
                    fulfillment_attempt: 0
                  - type: order_completed
                    recorded_at: 2023-10-23T23:21:04.653Z
                    order_handle: order-1
                    route_handle: 8c167253-3a4f-4f3c-95a4-4192a22f55d4
                    order_type: drop
                  - type: order_geofence_exited
                    recorded_at: 2023-10-23T23:21:04.856Z
                    location:
                      geometry: null
                      recorded_at: 2023-10-23T23:21:04.856Z
                    duration: 561
                    distance: null
                    order_handle: order-1
                    order_id: 26c2c782-805a-4404-9b85-82be76dba0e2
                    order_type: drop
                    fulfillment_attempt: 0
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Order Timeline
      description: >-
        Get order timeline by order_handle


        ### Planning failure reasons


        When an order is left unplanned by automated planning,
        `planning_failure_reason` may contain one of these values:


        - `No Worker was available for this plan.`

        - `No Worker schedule overlaps with this order's time window.`

        - `This order is outside the available Worker working hours.`

        - `Worker location is unavailable, so travel time could not be
        evaluated.`

        - `Worker start location is unavailable for the configured route start
        setting.`

        - `No Worker supports the required product type for this order.`

        - `Route was being modified concurrently and this order needs to be
        re-planned.`

        - `The optimizer dropped this order to satisfy planning constraints for
        the overall plan.`

        - `The optimizer could not find a feasible plan for the provided
        constraints.`

        - `Travel time calculation failed for this planning attempt.`

        - `Ops group configuration is incomplete for automated planning.`

        - `Assigning this order would exceed route or Worker capacity.`

        - `No Worker can reach this order before scheduled_at.`

        - `Assigning this order would delay an already planned downstream
        order.`

        - `Assigning this order would exceed the Worker's shift end time.`

        - `Automated planning could not assign this order with the provided
        constraints.`
      security:
        - BasicAuth: []
        - TokenAuth: []
    patch:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: type
          description: Type of the order which can be `drop` or `pick`
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: type_index
          description: Integer representing the `pick` or `drop` order index when having a
            pick/drop scenario
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: The attempt number for fulfilling the order
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PatchOrderResponse"
              examples:
                Update metadata:
                  summary: Update the order metadata
                  value:
                    order_handle: order-1
                    fulfillment_attempt: 0
                    status: unplanned
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8871193
                          - 37.390611
                      address: 1709 Automation Pkwy, San Jose, CA 95101
                      radius: 100
                    ops_group_handle: store-SF
                    track_mode: on_time
                    plan_mode: manual
                    scheduled_at: 2023-10-31T02:00:00.000Z
                    type: drop
                    type_index: 0
                    expected_service_time: 0
                    capacity_used: 1
                    metadata:
                      customerId: "1442"
                      name: Jordan
                    region:
                      country: United States
                      city: San Jose
                      state: California
                    product_type:
                      - frozen
                      - fragile
                    created_at: 2023-10-30T22:22:54.071Z
                    visited_destination: false
                    timeline: []
                Update schedule:
                  summary: Update the order schedule
                  value:
                    order_handle: order-1
                    fulfillment_attempt: 0
                    status: unplanned
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8871193
                          - 37.390611
                      address: 1709 Automation Pkwy, San Jose, CA 95101
                      radius: 100
                    ops_group_handle: store-SF
                    track_mode: on_time
                    plan_mode: manual
                    scheduled_after: 2023-10-31T02:00:00.000Z
                    scheduled_at: 2023-10-31T04:00:00.000Z
                    type: drop
                    type_index: 0
                    expected_service_time: 0
                    capacity_used: 1
                    metadata:
                      customerId: "1442"
                      name: Jordan
                    region:
                      country: United States
                      city: San Jose
                      state: California
                    product_type:
                      - frozen
                      - fragile
                    created_at: 2023-10-30T22:22:54.071Z
                    visited_destination: false
                    timeline: []
                Update product_type:
                  summary: Update the order product_type
                  value:
                    order_handle: order-1
                    fulfillment_attempt: 0
                    status: unplanned
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8871193
                          - 37.390611
                      address: 1709 Automation Pkwy, San Jose, CA 95101
                      radius: 100
                    ops_group_handle: store-SF
                    track_mode: on_time
                    plan_mode: manual
                    scheduled_after: 2023-10-31T02:00:00.000Z
                    scheduled_at: 2023-10-31T04:00:00.000Z
                    type: drop
                    type_index: 0
                    expected_service_time: 0
                    capacity_used: 1
                    metadata:
                      customerId: "1442"
                      name: Jordan
                    region:
                      country: United States
                      city: San Jose
                      state: California
                    product_type:
                      - frozen
                      - fragile
                      - valuable
                    created_at: 2023-10-30T22:22:54.071Z
                    visited_destination: false
                    timeline: []
                Update destination:
                  summary: Update the order destination
                  value:
                    order_handle: order-1
                    fulfillment_attempt: 0
                    status: unplanned
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8970798
                          - 37.3838274
                      address: 1710 Old Oakland Rd, San Jose, CA 95131
                    ops_group_handle: store-SF
                    track_mode: on_time
                    plan_mode: manual
                    scheduled_after: 2023-10-31T02:00:00.000Z
                    scheduled_at: 2023-10-31T04:00:00.000Z
                    type: drop
                    type_index: 0
                    expected_service_time: 0
                    capacity_used: 1
                    metadata:
                      customerId: "1442"
                      name: Jordan
                    region:
                      country: United States
                      city: San Jose
                      state: California
                    product_type:
                      - frozen
                      - fragile
                      - valuable
                    created_at: 2023-10-30T22:22:54.071Z
                    visited_destination: false
                    timeline: []
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Update Order
      description: Update information for an order identified by the order handle
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchOrderRequest"
            examples:
              Update metadata:
                summary: Update the order metadata
                value:
                  metadata:
                    customerId: "1442"
                    name: Jordan
              Update schedule:
                summary: Update the order schedule
                value:
                  scheduled_after: 2023-10-31T02:00:00Z
                  scheduled_at: 2023-10-31T04:00:00Z
              Update product_type:
                summary: Update the order product_type
                value:
                  product_type:
                    - frozen
                    - fragile
                    - valuable
              Update destination:
                summary: Update the order destination
                value:
                  destination:
                    address: 1710 Old Oakland Rd, San Jose, CA 95131
                    geometry:
                      type: Point
                      coordinates:
                        - -121.8970798
                        - 37.3838274
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/plans/{plan_id}:
    get:
      parameters:
        - in: path
          name: plan_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetPlanResponse"
              example:
                plan_id: 352a45c3-99b7-4528-9eca-a6f318c2ca23
                status: failed
                started_at: 2023-10-19T12:34:45.000Z
                fulfillment_date: 2023-10-19
                created_at: 2023-10-19T12:32:45.000Z
                ops_group_handle: d57deee8-d75f-4db5-ad37-4985ddcb47ac
                sequence_number: 2
                failure_reason: No Workers Available
                routes:
                  - route_handle: route-1
                    ops_group_handle: SAN_JOSE_WH
                    plan_mode: manual
                    status: completed
                    completed_at: 2023-03-14T23:55:00Z
                    worker_handle: James
                    version: 1
                    estimate:
                      start_by: 2023-03-14T23:20:00Z
                      distance: 1000
                      duration: 600
                      polyline:
                        type: LineString
                        coordinates:
                          - - 77.72123
                            - 12.89617
                          - - 77.72169
                            - 12.89595
                          - - 77.72214
                            - 12.89572
                      start_location:
                        type: Point
                        coordinates:
                          - -121.8924515
                          - 37.4124516
                      end_location:
                        type: Point
                        coordinates:
                          - -121.8984515
                          - 37.5124516
                    orders:
                      - order_handle: order-101
                        fulfillment_attempt: 1
                        status: completed
                        completed_at: 2023-03-14T23:55:00Z
                        ops_group_handle: store-sjc
                        worker_handle: James
                        device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                        created_at: 2023-03-14T23:00:00Z
                        scheduled_at: 2023-03-14T23:50:00Z
                        scheduled_after: 2023-03-14T23:20:00Z
                        metadata:
                          customerId: "1223344"
                        region:
                          city: Fremont
                          state: California
                          country: United States of America
                        destination:
                          geometry:
                            type: Point
                            coordinates:
                              - -121.8984515
                              - 37.5124516
                          radius: 50
                          address: Mission Peak, Fremont CA 94539
                        risk_status: false
                        expected_service_time: 600
                        product_type:
                          - plumber
                        type: drop
                        capacity_used: 5
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    metadata:
                      customerId: "4255534"
                      zone: 4
                    embed_url: https://embed.hypertrack.com/dkdkddnd
                unplanned_orders:
                  - order_handle: ORD_1223
                    status: unplanned
                    type: drop
                    planning_failure_reason: The optimizer dropped this order to satisfy planning
                      constraints for the overall plan.
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Plan
      description: >-
        API to fetch plan by Plan ID


        ### Planning failure reasons


        When an order is left unplanned by automated planning,
        `planning_failure_reason` may contain one of these values:


        - `No Worker was available for this plan.`

        - `No Worker schedule overlaps with this order's time window.`

        - `This order is outside the available Worker working hours.`

        - `Worker location is unavailable, so travel time could not be
        evaluated.`

        - `Worker start location is unavailable for the configured route start
        setting.`

        - `No Worker supports the required product type for this order.`

        - `Route was being modified concurrently and this order needs to be
        re-planned.`

        - `The optimizer dropped this order to satisfy planning constraints for
        the overall plan.`

        - `The optimizer could not find a feasible plan for the provided
        constraints.`

        - `Travel time calculation failed for this planning attempt.`

        - `Ops group configuration is incomplete for automated planning.`

        - `Assigning this order would exceed route or Worker capacity.`

        - `No Worker can reach this order before scheduled_at.`

        - `Assigning this order would delay an already planned downstream
        order.`

        - `Assigning this order would exceed the Worker's shift end time.`

        - `Automated planning could not assign this order with the provided
        constraints.`
      security:
        - BasicAuth: []
        - TokenAuth: []
  /tracking/{tracking_id}:
    get:
      parameters:
        - in: path
          name: tracking_id
          schema:
            type: string
          required: true
        - in: query
          name: include_inferences
          description: indicate whether to include inferences or not
          schema:
            type: boolean
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TrackingResponse"
          description: Successful response
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Tracking
      summary: Get tracking data
      description: Fetch tracking data for a tracking id.
  /orders/export/{job_id}:
    get:
      parameters:
        - in: path
          name: job_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrderExportStatusResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Orders
        - Export
      summary: Get export job status
      description: Check the status of an export job by job_id. Returns current
        status, progress, and download URL when completed.
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/{worker_handle}:
    get:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
        - in: query
          name: include_deleted
          description: Flag to fetch deleted worker
          schema:
            type: boolean
            default: false
          required: false
        - in: query
          name: from_time
          description: "ISO 8601 datetime indicating the start time. Default time range 24
            hours. "
          schema:
            type: string
            format: date-time
            nullable: true
          required: false
        - in: query
          name: to_time
          description: ISO 8601 datetime indicating the end time. Default time range 24
            hours.
          schema:
            type: string
            format: date-time
            nullable: true
          required: false
        - in: query
          name: date
          description: "ISO 8601 date format ('yyyy-MM-dd') indicating date to be used for
            the summary computation.<br> Default: current date in worker's
            timezone."
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: include_summary
          description: Flag to include worker summary. Default true.
          schema:
            type: boolean
            default: true
          required: false
        - in: query
          name: include_schedule
          description: Flag to include worker schedule. Default true.
          schema:
            type: boolean
            default: true
          required: false
        - in: query
          name: include_timeline
          description: Flag to include worker timeline. Default false.
          schema:
            type: boolean
            default: false
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetWorkerTimelineResponse"
              example:
                worker_handle: james@ht.com
                name: James
                ops_group_handle: store-sf
                product_types:
                  - plumbing
                  - hardware
                device_id: 00000000-4636-461C-B5F6-7E4BEFC09575
                profile:
                  workerId: "0012244"
                  vehicle: Ford F-150
                  zoneId: "4"
                status:
                  available: false
                  working: false
                schedule:
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: MONDAY
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: TUESDAY
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: WEDNESDAY
                created_at: 2023-06-01T02:00:00Z
                home:
                  address: 777 Story Rd, San Jose, CA 95122
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8624398
                      - 37.3304521
                  radius: 100
                location:
                  accuracy: 17.47
                  geometry:
                    coordinates:
                      - -121.877304
                      - 37.371943
                      - 29.26
                    type: Point
                  speed: 0
                device_status:
                  data:
                    activity: drive
                    recorded_at: 2023-10-03T20:42:44.969Z
                  value: active
                devices:
                  - device_id: 00000000-4636-461C-B5F6-7E4BEFC09575
                    start_time: 2023-10-03T20:42:38Z
                summary:
                  orders:
                    completed: 4
                    cancelled: 1
                    assigned: 0
                    ongoing: 2
                  geotags: 4
                  visits: 4
                  distance: 3000
                  duration: 120
                  tracking_rate: 92.8
                work_started_at: 2023-06-06T14:00:00Z
                timeline:
                  - type: route_started
                    recorded_at: 2023-06-06T14:00:00Z
                    route_handle: route_1
                    data: {}
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8624398
                          - 37.3304521
                  - type: order_completed
                    recorded_at: 2023-06-06T14:15:00Z
                    order_handle: order_1
                    data: {}
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8624389
                          - 37.3304522
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Get Worker By Handle
      description: Fetch the details for a worker using the worker_handle
      security:
        - BasicAuth: []
        - TokenAuth: []
    patch:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PatchWorkerResponse"
              example:
                worker_handle: james@ht.com
                ops_group_handle: store-sf
                product_types:
                  - plumbing
                  - hardware
                device_id: 00000000-4636-461C-B5F6-7E4BEFC09575
                profile:
                  workerId: "0012244"
                  vehicle: Ford F-150
                  zoneId: "4"
                status:
                  available: false
                  working: false
                schedule:
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: MONDAY
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: TUESDAY
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: WEDNESDAY
                created_at: 2023-06-01T02:00:00Z
                home:
                  address: 777 Story Rd, San Jose, CA 95122
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8624398
                      - 37.3304521
                  radius: 100
                device_status:
                  data:
                    activity: drive
                    recorded_at: 2023-10-03T20:42:44.969Z
                  value: active
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Patch Worker
      description: Update worker information using the worker_handle
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchWorkerRequest"
            example:
              schedule:
                - start_time: 02:00
                  end_time: 18:00
                  day_of_week: MONDAY
                - start_time: 02:00
                  end_time: 18:00
                  day_of_week: TUESDAY
                - start_time: 02:00
                  end_time: 18:00
                  day_of_week: WEDNESDAY
      security:
        - BasicAuth: []
        - TokenAuth: []
    delete:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
      responses:
        "204":
          description: Worker deleted successfully
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
      tags:
        - Workers
      summary: Delete Worker
      description: Delete a worker
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/export/{job_id}:
    get:
      parameters:
        - in: path
          name: job_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WorkerExportStatusResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
      tags:
        - Workers
        - WorkerExport
      summary: Get worker export job status
      description: Check the status of a worker export job by job_id. Returns current
        status, progress, and download URL when completed.
      security:
        - BasicAuth: []
        - TokenAuth: []
  /geotags/{geotag_id}:
    get:
      parameters:
        - in: path
          name: geotag_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetGeotagTimelineResponse"
              example:
                geotag_id: befe814d-79e5-44d5-ac03-c4e47e0931c9
                order_handle: order-1
                geotag_type: PICKUP
                ops_group_handle: store-san-jose
                system_generated_order_handle: false
                recorded_at: 2023-04-19T14:00:58Z
                device_id: 00112233-4455-6677-8899-AABBCCDDEEFF
                worker_handle: james_smith
                driver_name: James Smith
                metadata:
                  regionId: 12234
                  zoneId: 3
                location:
                  geometry:
                    type: Point
                    coordinates:
                      - -122.3599933082254
                      - 37.753651385106075
                  address: Dolores St &, 19th St, San Francisco, CA 94114
                expected_location:
                  geometry:
                    type: Point
                    coordinates:
                      - -122.4297458
                      - 37.7617545
                  address: 3750 18th St, San Francisco, CA 94114
                distance: 2300
                duration: 1200
                tracking_rate: 86.5
                deviation: 500
                start_location:
                  geometry:
                    type: Point
                    coordinates:
                      - -122.4526714
                      - 37.7652444
                  address: 941 Cole St, San Francisco, CA 94117
                region:
                  city: San Francisco
                  state: California
                  country: United States of America
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
      tags:
        - Geotags
      summary: Get Geotag Timeline
      description: Retrieve a geotag identified by the geotag_id.
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/tasks-definitions:
    get:
      parameters:
        - in: query
          name: search_term
          description: Filter task definitions by label. Use this to search for task
            definitions with label containing search term.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: ops_group_handle
          description: Filter task definitions by ops group handle.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: metadata
          description: Filter task definitions by metadata. Use this to search for task
            definitions with metadata containing the specified key-value pairs.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Token for pagination. Use this to fetch the next set of results if
            available.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Maximum number of task definitions to return. Default is 100,
            maximum is 100.
          schema:
            type: integer
            default: 100
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TasksDefinitionListResponse"
              example:
                task_definitions:
                  - task_definition_id: c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f
                    label: order_tasks_definition 1
                    tasks:
                      - label: order_summary
                        description: Generate order summary for order 001
                        priority: high
                      - label: order_billing_summary
                        description: Generate billing summary for order 001
                        priority: medium
                    created_at: 2023-10-01T12:00:00Z
                    updated_at: 2023-10-01T12:00:00Z
                pagination_token: null
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Tasks Definitions List
      description: Retrieves a list of all task definitions available in the system.
        This endpoint is used to view all task definitions that can be used for
        orders.
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters: []
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TasksDefinitionResponse"
              example:
                task_definition_id: c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f
                label: order_tasks_definition 1
                tasks:
                  - label: order_summary
                    description: Generate order summary for order 001
                    priority: high
                  - label: order_billing_summary
                    description: Generate billing summary for order 001
                    priority: medium
                created_at: 2023-10-01T12:00:00Z
                updated_at: 2023-10-01T12:00:00Z
          description: Successful response
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                ops_group_not_defined:
                  summary: ops_group_not_defined
                  value:
                    code: ops_group_not_defined
                    title: Ops Group is not defined
                    detail:
                      description: Ops Group <ops_group_handle> does not exist
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Create Tasks Definition
      description: Creates a new task definition for an order. This endpoint is used
        to define the structure and requirements of tasks that can be created
        for orders.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateTasksDefinitionRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/tasks:
    get:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: fulfillment_attempt
          description: The attempt number for order fulfillment.
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrderTaskListResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                order_not_found:
                  summary: order_not_found
                  value:
                    code: order_not_found
                    title: Order Not Found
                    detail:
                      description: Order not found for handle <order_handle>
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: List Order Tasks
      description: "Retrieves a list of all tasks associated with a specific order. "
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: fulfillment_attempt
          description: The attempt number for order fulfillment.
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CreateOrderTasksResponse"
              example:
                tasks:
                  - task_id: b7e6f8c2-1d2a-4e3b-9c3d-2e5a6b7c8d9e
                    label: order_summary
                    description: Generate order summary for order 001
                    status: created
                    priority: high
                    created_at: 2023-10-01T12:00:00Z
                    updated_at: 2023-10-01T12:00:00Z
                  - task_id: a2f4c6e8-3b1d-4c2e-8f9a-1b2c3d4e5f6a
                    label: order_billing_summary
                    description: Generate billing summary for order 001
                    status: created
                    priority: medium
                    created_at: 2023-10-01T12:00:00Z
                    updated_at: 2023-10-01T12:00:00Z
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                order_not_found:
                  summary: order_not_found
                  value:
                    code: order_not_found
                    title: Order Not Found
                    detail:
                      description: Order not found for handle <order_handle>
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Create Order Tasks
      description: Creates tasks for an order. The tasks are created based on the
        provided request parameters. This endpoint is used to manage tasks
        associated with orders in the system.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateOrderTasksRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/events:
    post:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
      responses:
        "201":
          content:
            application/json:
              schema: {}
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Add Custom Order Events
      description: Add Custom order events to an order identified by order handle
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CustomOrderEventRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/cancel:
    post:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: type
          description: Type of the order which can be `drop` or `pick`
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: type_index
          description: Integer representing the `pick` or `drop` order index when having a
            pick/drop scenario
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: The attempt number for fulfilling the order
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CancelOrderResponse"
              example:
                order_handle: order-1
                fulfillment_attempt: 0
                status: cancelled
                destination:
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8610066
                      - 37.3263062
                  address: 748 Story Rd, San Jose, CA 95112
                  radius: 100
                ops_group_handle: store-sf
                track_mode: on_time
                plan_mode: manual
                risks:
                  moving_away_from_destination: green
                  is_offline: green
                  delayed_from_scheduled_at: green
                  deviating_from_expected_route: green
                  moving_too_slow: green
                  in_outage: green
                  delayed_from_initial_eta: green
                  in_low_battery: green
                scheduled_at: 2023-10-26T02:30:00.000Z
                started_at: 2023-10-26T01:28:22.016Z
                type: drop
                type_index: 0
                expected_service_time: 0
                actual_service_time: 0
                tracked_service_time: 0
                capacity_used: 1
                metadata:
                  customerID: "12654"
                region:
                  country: United States
                  city: San Jose
                  state: California
                share_url: https://trck.at/gv2oZRGKqB
                cancelled_at: 2023-10-26T01:37:03.650Z
                disabled_at: 2023-10-26T01:32:43.721Z
                device_id: 52193948-1A79-47CC-AB81-2FB0A59536D1
                worker_handle: James
                created_at: 2023-10-25T17:54:42.233Z
                assigned_at: 2023-10-26T01:27:40.170Z
                route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                plan_id: 0f3415f2-63b7-4727-83d2-010e88b48715
                distance: 0
                duration: 520
                polyline:
                  type: LineString
                  coordinates:
                    - - -121.877261
                      - 37.371918
                      - 24.98
                      - 2023-10-26T01:28:23.916Z
                    - - -121.877261
                      - 37.371918
                      - 24.98
                      - 2023-10-26T01:28:24.045Z
                    - - -121.877246
                      - 37.371916
                      - 24.49
                      - 2023-10-26T01:29:24.055Z
                    - - -121.877246
                      - 37.371916
                      - 24.49
                      - 2023-10-26T01:31:24.080Z
                    - - -121.877246
                      - 37.371916
                      - 24.49
                      - 2023-10-26T01:34:24.103Z
                start_location:
                  type: Point
                  coordinates:
                    - -121.877261
                    - 37.371918
                end_location:
                  type: Point
                  coordinates:
                    - -121.877246
                    - 37.371916
                visited_destination: false
                cancelled_at_destination: false
                timeline:
                  - type: order_created
                    recorded_at: 2023-10-25T17:54:42.233Z
                    order_handle: order-2
                    metadata:
                      customerID: "12654"
                  - type: order_assigned
                    recorded_at: 2023-10-26T01:27:40.170Z
                    order_handle: order-2
                    driver_handle: James
                    fulfillment_attempt: 0
                  - type: order_started
                    recorded_at: 2023-10-26T01:28:22.016Z
                    order_handle: order-2
                    route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                    order_type: drop
                    fulfillment_attempt: 0
                  - type: driver_activity_started
                    recorded_at: 2023-10-26T01:28:23.916Z
                    driver_handle: null
                    activity: stop
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.877261
                          - 37.371918
                      recorded_at: 2023-10-26T01:28:23.916Z
                    address: 1653, De Rome Drive, San Jose, Santa Clara County, California, 95131,
                      United States
                  - type: order_disabled
                    recorded_at: 2023-10-26T01:32:43.721Z
                    order_handle: order-2
                    route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                    fulfillment_attempt: 0
                  - type: driver_activity_ended
                    recorded_at: 2023-10-26T01:34:24.103Z
                    driver_handle: null
                    activity: stop
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.877246
                          - 37.371916
                      recorded_at: 2023-10-26T01:34:24.103Z
                    distance: null
                    duration: 360
                    steps: 0
                  - type: order_cancelled
                    recorded_at: 2023-10-26T01:37:03.650Z
                    order_handle: order-2
                    route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                    fulfillment_attempt: 0
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Cancel Order
      description: Cancel an order identified by the given order_handle
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CancelOrderRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/enable:
    post:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: type
          description: Type of the order which can be `drop` or `pick`
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: type_index
          description: Integer representing the `pick` or `drop` order index when having a
            pick/drop scenario
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: The attempt number for fulfilling the order
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EnableOrderResponse"
              example:
                order_handle: order-1
                fulfillment_attempt: 0
                status: ongoing
                destination:
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8610066
                      - 37.3263062
                  address: 748 Story Rd, San Jose, CA 95112
                  radius: 100
                ops_group_handle: store-sf
                track_mode: on_time
                plan_mode: manual
                scheduled_at: 2023-10-26T02:30:00.000Z
                started_at: 2023-10-26T01:28:22.016Z
                type: drop
                type_index: 0
                expected_service_time: 0
                capacity_used: 1
                metadata:
                  customerID: "12654"
                region:
                  country: United States
                  city: San Jose
                  state: California
                share_url: https://trck.at/gv2oZRGKqB
                disabled_at: 2023-10-26T01:32:43.721Z
                device_id: 52193948-1A79-47CC-AB81-2FB0A59536D1
                worker_handle: James
                created_at: 2023-10-25T17:54:42.233Z
                assigned_at: 2023-10-26T01:27:40.170Z
                route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                plan_id: 0f3415f2-63b7-4727-83d2-010e88b48715
                estimate:
                  start_by: 2023-10-26T02:17:39.000Z
                  arrive_at: 2023-10-26T01:45:07.251Z
                  polyline:
                    type: LineString
                    coordinates:
                      - - -121.88604
                        - 37.39095
                      - - -121.88548
                        - 37.39126
                      - - -121.88531
                        - 37.3913
                      - - -121.88513
                        - 37.39153
                      - - -121.88509
                        - 37.39158
                      - - -121.88509
                        - 37.39158
                      - - -121.88424
                        - 37.39117
                      - - -121.88398
                        - 37.39104
                      - - -121.88382
                        - 37.39093
                      - - -121.88367
                        - 37.39078
                      - - -121.88358
                        - 37.39062
                      - - -121.88355
                        - 37.39052
                      - - -121.8834
                        - 37.39007
                      - - -121.88323
                        - 37.38956
                      - - -121.88312
                        - 37.38922
                      - - -121.88303
                        - 37.38896
                      - - -121.883
                        - 37.38888
                      - - -121.8829
                        - 37.38864
                      - - -121.8829
                        - 37.38863
                      - - -121.88284
                        - 37.38851
                      - - -121.88264
                        - 37.38816
                      - - -121.88259
                        - 37.38805
                      - - -121.88259
                        - 37.38805
                      - - -121.88251
                        - 37.38791
                      - - -121.8823
                        - 37.38799
                      - - -121.88212
                        - 37.38807
                      - - -121.88195
                        - 37.38815
                      - - -121.8818
                        - 37.38825
                      - - -121.88165
                        - 37.38835
                      - - -121.88147
                        - 37.3885
                      - - -121.88139
                        - 37.38865
                      - - -121.88125
                        - 37.38872
                      - - -121.88107
                        - 37.38892
                      - - -121.88074
                        - 37.38926
                      - - -121.8796
                        - 37.39044
                      - - -121.87951
                        - 37.39053
                      - - -121.87939
                        - 37.39066
                      - - -121.87936
                        - 37.39069
                      - - -121.8792
                        - 37.39085
                      - - -121.87912
                        - 37.39094
                      - - -121.87903
                        - 37.39103
                      - - -121.87892
                        - 37.39115
                      - - -121.87867
                        - 37.3914
                      - - -121.87852
                        - 37.39156
                      - - -121.87812
                        - 37.39197
                      - - -121.87773
                        - 37.39241
                      - - -121.87769
                        - 37.39246
                      - - -121.87731
                        - 37.39279
                      - - -121.8766
                        - 37.39325
                      - - -121.87654
                        - 37.39329
                      - - -121.87649
                        - 37.39332
                      - - -121.87617
                        - 37.39354
                      - - -121.87608
                        - 37.3936
                      - - -121.876
                        - 37.39366
                      - - -121.87559
                        - 37.39395
                      - - -121.87521
                        - 37.39422
                      - - -121.87521
                        - 37.39422
                      - - -121.87489
                        - 37.39434
                      - - -121.87481
                        - 37.39437
                      - - -121.87471
                        - 37.39439
                      - - -121.8747
                        - 37.3944
                      - - -121.87463
                        - 37.3944
                      - - -121.87454
                        - 37.39441
                      - - -121.87446
                        - 37.39441
                      - - -121.87437
                        - 37.3944
                      - - -121.87429
                        - 37.39438
                      - - -121.87421
                        - 37.39436
                      - - -121.87413
                        - 37.39432
                      - - -121.87407
                        - 37.39427
                      - - -121.87401
                        - 37.39422
                      - - -121.87328
                        - 37.39346
                      - - -121.87289
                        - 37.39308
                      - - -121.87264
                        - 37.39285
                      - - -121.87241
                        - 37.39264
                      - - -121.87194
                        - 37.39227
                      - - -121.87103
                        - 37.39154
                      - - -121.86896
                        - 37.38989
                      - - -121.86896
                        - 37.38989
                      - - -121.8675
                        - 37.38856
                      - - -121.86335
                        - 37.3847
                      - - -121.86195
                        - 37.38342
                      - - -121.86086
                        - 37.38239
                      - - -121.8599
                        - 37.38148
                      - - -121.85871
                        - 37.38032
                      - - -121.85847
                        - 37.38008
                      - - -121.85526
                        - 37.37692
                      - - -121.85177
                        - 37.3734
                      - - -121.85124
                        - 37.37287
                      - - -121.84728
                        - 37.369
                      - - -121.84693
                        - 37.36865
                      - - -121.84657
                        - 37.36826
                      - - -121.84618
                        - 37.3678
                      - - -121.8458
                        - 37.3673
                      - - -121.84547
                        - 37.36683
                      - - -121.84514
                        - 37.36633
                      - - -121.84366
                        - 37.36374
                      - - -121.84331
                        - 37.36315
                      - - -121.8419
                        - 37.36083
                      - - -121.83892
                        - 37.35586
                      - - -121.83878
                        - 37.35562
                      - - -121.83864
                        - 37.35538
                      - - -121.8384
                        - 37.35477
                      - - -121.83827
                        - 37.35448
                      - - -121.83815
                        - 37.35406
                      - - -121.83807
                        - 37.3536
                      - - -121.83805
                        - 37.35312
                      - - -121.83803
                        - 37.3529
                      - - -121.83804
                        - 37.35266
                      - - -121.83808
                        - 37.35237
                      - - -121.83812
                        - 37.35202
                      - - -121.83819
                        - 37.35165
                      - - -121.8383
                        - 37.35125
                      - - -121.83847
                        - 37.35079
                      - - -121.83866
                        - 37.35039
                      - - -121.8389
                        - 37.34998
                      - - -121.83914
                        - 37.34961
                      - - -121.83943
                        - 37.34925
                      - - -121.8397
                        - 37.34894
                      - - -121.83991
                        - 37.34873
                      - - -121.84015
                        - 37.34852
                      - - -121.8406
                        - 37.34815
                      - - -121.84205
                        - 37.34701
                      - - -121.84429
                        - 37.34518
                      - - -121.84493
                        - 37.34467
                      - - -121.84546
                        - 37.34426
                      - - -121.84637
                        - 37.34354
                      - - -121.84672
                        - 37.34325
                      - - -121.84746
                        - 37.34267
                      - - -121.84799
                        - 37.34229
                      - - -121.8486
                        - 37.34187
                      - - -121.84895
                        - 37.34165
                      - - -121.84921
                        - 37.3415
                      - - -121.84945
                        - 37.34134
                      - - -121.85024
                        - 37.34086
                      - - -121.85099
                        - 37.34039
                      - - -121.85168
                        - 37.33999
                      - - -121.85205
                        - 37.33976
                      - - -121.85241
                        - 37.33954
                      - - -121.85674
                        - 37.33688
                      - - -121.857
                        - 37.33672
                      - - -121.85723
                        - 37.33658
                      - - -121.85755
                        - 37.33639
                      - - -121.85826
                        - 37.33597
                      - - -121.85888
                        - 37.33559
                      - - -121.86067
                        - 37.3345
                      - - -121.86083
                        - 37.3344
                      - - -121.86137
                        - 37.33406
                      - - -121.86482
                        - 37.33189
                      - - -121.86607
                        - 37.33111
                      - - -121.86766
                        - 37.33014
                      - - -121.86812
                        - 37.32987
                      - - -121.86851
                        - 37.32966
                      - - -121.86851
                        - 37.32966
                      - - -121.86877
                        - 37.32966
                      - - -121.869
                        - 37.32957
                      - - -121.86935
                        - 37.32944
                      - - -121.86977
                        - 37.3293
                      - - -121.87043
                        - 37.32908
                      - - -121.87051
                        - 37.32907
                      - - -121.87078
                        - 37.329
                      - - -121.87104
                        - 37.32894
                      - - -121.87121
                        - 37.32891
                      - - -121.87129
                        - 37.32889
                      - - -121.87142
                        - 37.32886
                      - - -121.87173
                        - 37.32881
                      - - -121.87186
                        - 37.32879
                      - - -121.87204
                        - 37.32876
                      - - -121.87214
                        - 37.32874
                      - - -121.87214
                        - 37.32874
                      - - -121.87207
                        - 37.32863
                      - - -121.87185
                        - 37.32834
                      - - -121.87154
                        - 37.32791
                      - - -121.87149
                        - 37.32785
                      - - -121.871
                        - 37.3272
                      - - -121.87096
                        - 37.32715
                      - - -121.87091
                        - 37.32708
                      - - -121.87091
                        - 37.32708
                      - - -121.87082
                        - 37.32696
                      - - -121.86993
                        - 37.32577
                      - - -121.86988
                        - 37.32571
                      - - -121.86983
                        - 37.32565
                      - - -121.86951
                        - 37.32521
                      - - -121.86908
                        - 37.32463
                      - - -121.86885
                        - 37.32432
                      - - -121.86878
                        - 37.32423
                      - - -121.86878
                        - 37.32423
                      - - -121.86868
                        - 37.32427
                      - - -121.86858
                        - 37.32433
                      - - -121.86843
                        - 37.3244
                      - - -121.86836
                        - 37.32443
                      - - -121.86831
                        - 37.32446
                      - - -121.86821
                        - 37.32451
                      - - -121.86785
                        - 37.32469
                      - - -121.86783
                        - 37.3247
                      - - -121.86775
                        - 37.32474
                      - - -121.86761
                        - 37.32475
                      - - -121.86714
                        - 37.32496
                      - - -121.86706
                        - 37.325
                      - - -121.86669
                        - 37.32518
                      - - -121.8665
                        - 37.32527
                      - - -121.86642
                        - 37.32531
                      - - -121.86624
                        - 37.3254
                      - - -121.86578
                        - 37.32562
                      - - -121.86567
                        - 37.32568
                      - - -121.86567
                        - 37.32568
                      - - -121.86557
                        - 37.32573
                      - - -121.86551
                        - 37.32576
                      - - -121.86535
                        - 37.32583
                      - - -121.86502
                        - 37.32596
                      - - -121.86315
                        - 37.32666
                      - - -121.86175
                        - 37.32732
                      - - -121.86175
                        - 37.32732
                  distance: 12781
                  duration: 741
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8871193
                      - 37.390611
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8610066
                      - 37.3263062
                visited_destination: false
                timeline: []
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Enable Order
      description: Enable an order identified by the given order_handle. This will
        recompute the ETA by including this order in the route.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/EnableOrderRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/routes/{route_handle}:
    get:
      parameters:
        - in: path
          name: route_handle
          schema:
            type: string
          required: true
        - in: query
          name: include_summary
          description: Whether to include polyline, distance, duration, start_location,
            completed_location and tracking rate
          schema:
            type: boolean
            default: true
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetOrdersByRouteHandleResponse"
              example:
                route_handle: 7ac07153-4490-46c5-9ada-a6ca84f5b48f
                status: completed
                version: 1
                embed_url: https://embed.hypertrack.com/trips/7ac07153-4490-46c5-9ada-a6ca84f5b48f?publishable_key=a5pvdQP3sFvLSuZrwssgJS_SqcfirX1n9qRBIn9nl3PTK-5y3BO56rolpGuzhp1pIoH4TiDyqWIq8IEkOJF5eg
                orders:
                  - order_handle: order-1
                    fulfillment_attempt: 0
                    status: completed
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - 17.803927
                          - 34.832173
                      address: 1709 Automation Pkwy, San Jose, CA 95101
                      radius: 100
                    track_mode: on_time
                    scheduled_at: 2023-11-02T02:00:00.000Z
                    started_at: 2023-11-01T22:47:56.027Z
                    type: pick
                    type_index: 0
                    expected_service_time: 0
                    actual_service_time: 0
                    tracked_service_time: 0
                    capacity_used: 1
                    share_url: https://trck.at/PvR8MmWEpf
                    completed_at: 2023-11-01T22:54:42.449Z
                    device_id: FB9D216D-4DF9-411A-AA61-AC66909555D7
                    worker_handle: james@ht.com
                    created_at: 2023-11-01T22:47:53.512Z
                    assigned_at: 2023-11-01T22:47:53.857Z
                    route_handle: 7ac07153-5590-46c5-9ada-a6ca84f5b48f
                    planned_at: 2023-11-01T22:47:53.512Z
                    distance: 1800
                    duration: 3000
                    tracking_rate: 98.2
                  - order_handle: order-2
                    fulfillment_attempt: 0
                    status: completed
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - 17.803927
                          - 34.832173
                      address: 748 Story Rd, San Jose, CA 95112
                      radius: 100
                    track_mode: on_time
                    scheduled_at: 2023-11-02T02:00:00.000Z
                    started_at: 2023-11-01T22:47:56.092Z
                    type: drop
                    type_index: 0
                    expected_service_time: 0
                    actual_service_time: 0
                    tracked_service_time: 0
                    capacity_used: 1
                    share_url: https://trck.at/NqV7Xm14pZ
                    completed_at: 2023-11-01T22:54:50.217Z
                    device_id: FB9D216D-4DF9-411A-AA61-AC66909555D7
                    worker_handle: james@ht.com
                    created_at: 2023-11-01T22:47:53.512Z
                    assigned_at: 2023-11-01T22:47:53.914Z
                    route_handle: 7ac07153-5590-46c5-9ada-a6ca84f5b48f
                    planned_at: 2023-11-01T22:47:53.512Z
                    distance: 0
                    duration: 0
                    tracking_rate: 77.5
                started_at: 2023-11-01T22:47:54.867Z
                assigned_at: 2023-11-01T22:47:53.968Z
                created_at: 2023-11-01T22:47:53.659Z
                device_id: FB9D216D-4DF9-411A-AA61-AC66909555D7
                worker_handle: james@ht.com
                completed_at: 2023-11-01T22:54:50.217Z
                planned_at: 2023-11-01T22:47:53.658Z
                duration: 16
                distance: 0
                tracking_rate: 0
                polyline:
                  type: LineString
                  coordinates:
                    - - -121.87727
                      - 37.371945
                      - 25.87
                      - 2023-11-01T22:54:34.104Z
                start_location:
                  type: Point
                  coordinates:
                    - -121.87727
                    - 37.371945
                end_location:
                  type: Point
                  coordinates:
                    - -121.87727
                    - 37.371945
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Order by Route Handle
      description: >-
        Get the orders by the `route_handle`


        ### Planning failure reasons


        When an order is left unplanned by automated planning,
        `planning_failure_reason` may contain one of these values:


        - `No Worker was available for this plan.`

        - `No Worker schedule overlaps with this order's time window.`

        - `This order is outside the available Worker working hours.`

        - `Worker location is unavailable, so travel time could not be
        evaluated.`

        - `Worker start location is unavailable for the configured route start
        setting.`

        - `No Worker supports the required product type for this order.`

        - `Route was being modified concurrently and this order needs to be
        re-planned.`

        - `The optimizer dropped this order to satisfy planning constraints for
        the overall plan.`

        - `The optimizer could not find a feasible plan for the provided
        constraints.`

        - `Travel time calculation failed for this planning attempt.`

        - `Ops group configuration is incomplete for automated planning.`

        - `Assigning this order would exceed route or Worker capacity.`

        - `No Worker can reach this order before scheduled_at.`

        - `Assigning this order would delay an already planned downstream
        order.`

        - `Assigning this order would exceed the Worker's shift end time.`

        - `Automated planning could not assign this order with the provided
        constraints.`
      security:
        - BasicAuth: []
        - TokenAuth: []
    patch:
      parameters:
        - in: path
          name: route_handle
          schema:
            type: string
          required: true
        - in: query
          name: version
          description: Route version
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PatchRouteResponse"
              example:
                route_handle: route-1
                ops_group_handle: SAN_JOSE_WH
                plan_mode: manual
                status: dispatched
                version: 1
                estimate:
                  start_by: 2023-03-14T23:20:00Z
                  distance: 1000
                  duration: 600
                  polyline:
                    type: LineString
                    coordinates:
                      - - 77.72123
                        - 12.89617
                      - - 77.72169
                        - 12.89595
                      - - 77.72214
                        - 12.89572
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8924515
                      - 37.4124516
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8984515
                      - 37.5124516
                orders:
                  - order_handle: order-101
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    worker_handle: James
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-14T23:50:00Z
                    scheduled_after: 2023-03-14T23:20:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: Fremont
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8984515
                          - 37.5124516
                      radius: 50
                      address: Mission Peak, Fremont CA 94539
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                metadata:
                  customerId: "4255534"
                  zone: 4
                embed_url: https://embed.hypertrack.com/dkdkddnd
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Update Route
      description: Update the route metadata
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchRouteRequest"
            example:
              metadata: '{"customerId": "4255534", "zone": 4}'
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/disable:
    post:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: type
          description: Type of the order which can be `drop` or `pick`
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: type_index
          description: Integer representing the `pick` or `drop` order index when having a
            pick/drop scenario
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: The attempt number for fulfilling the order
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DisableOrderResponse"
              example:
                order_handle: order-1
                fulfillment_attempt: 0
                status: disabled
                destination:
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8610066
                      - 37.3263062
                  address: 748 Story Rd, San Jose, CA 95112
                  radius: 100
                ops_group_handle: store-sf
                track_mode: on_time
                plan_mode: manual
                scheduled_at: 2023-10-26T02:30:00.000Z
                started_at: 2023-10-26T01:28:22.016Z
                type: drop
                type_index: 0
                expected_service_time: 0
                capacity_used: 1
                metadata:
                  customerID: "12654"
                region:
                  country: United States
                  city: San Jose
                  state: California
                share_url: https://trck.at/gv2oZRGKqB
                disabled_at: 2023-10-26T01:30:16.655Z
                device_id: 52193948-1A79-47CC-AB81-2FB0A59536D1
                worker_handle: James
                created_at: 2023-10-25T17:54:42.233Z
                assigned_at: 2023-10-26T01:27:40.170Z
                route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                plan_id: 0f3415f2-63b7-4727-83d2-010e88b48715
                estimate:
                  start_by: 2023-10-26T02:17:39.000Z
                  arrive_at: 2023-10-26T01:42:51.821Z
                  polyline:
                    type: LineString
                    coordinates:
                      - - -121.88604
                        - 37.39095
                      - - -121.88548
                        - 37.39126
                      - - -121.88531
                        - 37.3913
                      - - -121.88513
                        - 37.39153
                      - - -121.88509
                        - 37.39158
                      - - -121.88509
                        - 37.39158
                      - - -121.88424
                        - 37.39117
                      - - -121.88398
                        - 37.39104
                      - - -121.88382
                        - 37.39093
                      - - -121.88367
                        - 37.39078
                      - - -121.88358
                        - 37.39062
                      - - -121.88355
                        - 37.39052
                      - - -121.8834
                        - 37.39007
                      - - -121.88323
                        - 37.38956
                      - - -121.88312
                        - 37.38922
                      - - -121.88303
                        - 37.38896
                      - - -121.883
                        - 37.38888
                      - - -121.8829
                        - 37.38864
                      - - -121.8829
                        - 37.38863
                      - - -121.88284
                        - 37.38851
                      - - -121.88264
                        - 37.38816
                      - - -121.88259
                        - 37.38805
                      - - -121.88259
                        - 37.38805
                      - - -121.88251
                        - 37.38791
                      - - -121.8823
                        - 37.38799
                      - - -121.88212
                        - 37.38807
                      - - -121.88195
                        - 37.38815
                      - - -121.8818
                        - 37.38825
                      - - -121.88165
                        - 37.38835
                      - - -121.88147
                        - 37.3885
                      - - -121.88139
                        - 37.38865
                      - - -121.88125
                        - 37.38872
                      - - -121.88107
                        - 37.38892
                      - - -121.88074
                        - 37.38926
                      - - -121.8796
                        - 37.39044
                      - - -121.87951
                        - 37.39053
                      - - -121.87939
                        - 37.39066
                      - - -121.87936
                        - 37.39069
                      - - -121.8792
                        - 37.39085
                      - - -121.87912
                        - 37.39094
                      - - -121.87903
                        - 37.39103
                      - - -121.87892
                        - 37.39115
                      - - -121.87867
                        - 37.3914
                      - - -121.87852
                        - 37.39156
                      - - -121.87812
                        - 37.39197
                      - - -121.87773
                        - 37.39241
                      - - -121.87769
                        - 37.39246
                      - - -121.87731
                        - 37.39279
                      - - -121.8766
                        - 37.39325
                      - - -121.87654
                        - 37.39329
                      - - -121.87649
                        - 37.39332
                      - - -121.87617
                        - 37.39354
                      - - -121.87608
                        - 37.3936
                      - - -121.876
                        - 37.39366
                      - - -121.87559
                        - 37.39395
                      - - -121.87521
                        - 37.39422
                      - - -121.87521
                        - 37.39422
                      - - -121.87489
                        - 37.39434
                      - - -121.87481
                        - 37.39437
                      - - -121.87471
                        - 37.39439
                      - - -121.8747
                        - 37.3944
                      - - -121.87463
                        - 37.3944
                      - - -121.87454
                        - 37.39441
                      - - -121.87446
                        - 37.39441
                      - - -121.87437
                        - 37.3944
                      - - -121.87429
                        - 37.39438
                      - - -121.87421
                        - 37.39436
                      - - -121.87413
                        - 37.39432
                      - - -121.87407
                        - 37.39427
                      - - -121.87401
                        - 37.39422
                      - - -121.87328
                        - 37.39346
                      - - -121.87289
                        - 37.39308
                      - - -121.87264
                        - 37.39285
                      - - -121.87241
                        - 37.39264
                      - - -121.87194
                        - 37.39227
                      - - -121.87103
                        - 37.39154
                      - - -121.86896
                        - 37.38989
                      - - -121.86896
                        - 37.38989
                      - - -121.8675
                        - 37.38856
                      - - -121.86335
                        - 37.3847
                      - - -121.86195
                        - 37.38342
                      - - -121.86086
                        - 37.38239
                      - - -121.8599
                        - 37.38148
                      - - -121.85871
                        - 37.38032
                      - - -121.85847
                        - 37.38008
                      - - -121.85526
                        - 37.37692
                      - - -121.85177
                        - 37.3734
                      - - -121.85124
                        - 37.37287
                      - - -121.84728
                        - 37.369
                      - - -121.84693
                        - 37.36865
                      - - -121.84657
                        - 37.36826
                      - - -121.84618
                        - 37.3678
                      - - -121.8458
                        - 37.3673
                      - - -121.84547
                        - 37.36683
                      - - -121.84514
                        - 37.36633
                      - - -121.84366
                        - 37.36374
                      - - -121.84331
                        - 37.36315
                      - - -121.8419
                        - 37.36083
                      - - -121.83892
                        - 37.35586
                      - - -121.83878
                        - 37.35562
                      - - -121.83864
                        - 37.35538
                      - - -121.8384
                        - 37.35477
                      - - -121.83827
                        - 37.35448
                      - - -121.83815
                        - 37.35406
                      - - -121.83807
                        - 37.3536
                      - - -121.83805
                        - 37.35312
                      - - -121.83803
                        - 37.3529
                      - - -121.83804
                        - 37.35266
                      - - -121.83808
                        - 37.35237
                      - - -121.83812
                        - 37.35202
                      - - -121.83819
                        - 37.35165
                      - - -121.8383
                        - 37.35125
                      - - -121.83847
                        - 37.35079
                      - - -121.83866
                        - 37.35039
                      - - -121.8389
                        - 37.34998
                      - - -121.83914
                        - 37.34961
                      - - -121.83943
                        - 37.34925
                      - - -121.8397
                        - 37.34894
                      - - -121.83991
                        - 37.34873
                      - - -121.84015
                        - 37.34852
                      - - -121.8406
                        - 37.34815
                      - - -121.84205
                        - 37.34701
                      - - -121.84429
                        - 37.34518
                      - - -121.84493
                        - 37.34467
                      - - -121.84546
                        - 37.34426
                      - - -121.84637
                        - 37.34354
                      - - -121.84672
                        - 37.34325
                      - - -121.84746
                        - 37.34267
                      - - -121.84799
                        - 37.34229
                      - - -121.8486
                        - 37.34187
                      - - -121.84895
                        - 37.34165
                      - - -121.84921
                        - 37.3415
                      - - -121.84945
                        - 37.34134
                      - - -121.85024
                        - 37.34086
                      - - -121.85099
                        - 37.34039
                      - - -121.85168
                        - 37.33999
                      - - -121.85205
                        - 37.33976
                      - - -121.85241
                        - 37.33954
                      - - -121.85674
                        - 37.33688
                      - - -121.857
                        - 37.33672
                      - - -121.85723
                        - 37.33658
                      - - -121.85755
                        - 37.33639
                      - - -121.85826
                        - 37.33597
                      - - -121.85888
                        - 37.33559
                      - - -121.86067
                        - 37.3345
                      - - -121.86083
                        - 37.3344
                      - - -121.86137
                        - 37.33406
                      - - -121.86482
                        - 37.33189
                      - - -121.86607
                        - 37.33111
                      - - -121.86766
                        - 37.33014
                      - - -121.86812
                        - 37.32987
                      - - -121.86851
                        - 37.32966
                      - - -121.86851
                        - 37.32966
                      - - -121.86877
                        - 37.32966
                      - - -121.869
                        - 37.32957
                      - - -121.86935
                        - 37.32944
                      - - -121.86977
                        - 37.3293
                      - - -121.87043
                        - 37.32908
                      - - -121.87051
                        - 37.32907
                      - - -121.87078
                        - 37.329
                      - - -121.87104
                        - 37.32894
                      - - -121.87121
                        - 37.32891
                      - - -121.87129
                        - 37.32889
                      - - -121.87142
                        - 37.32886
                      - - -121.87173
                        - 37.32881
                      - - -121.87186
                        - 37.32879
                      - - -121.87204
                        - 37.32876
                      - - -121.87214
                        - 37.32874
                      - - -121.87214
                        - 37.32874
                      - - -121.87207
                        - 37.32863
                      - - -121.87185
                        - 37.32834
                      - - -121.87154
                        - 37.32791
                      - - -121.87149
                        - 37.32785
                      - - -121.871
                        - 37.3272
                      - - -121.87096
                        - 37.32715
                      - - -121.87091
                        - 37.32708
                      - - -121.87091
                        - 37.32708
                      - - -121.87082
                        - 37.32696
                      - - -121.86993
                        - 37.32577
                      - - -121.86988
                        - 37.32571
                      - - -121.86983
                        - 37.32565
                      - - -121.86951
                        - 37.32521
                      - - -121.86908
                        - 37.32463
                      - - -121.86885
                        - 37.32432
                      - - -121.86878
                        - 37.32423
                      - - -121.86878
                        - 37.32423
                      - - -121.86868
                        - 37.32427
                      - - -121.86858
                        - 37.32433
                      - - -121.86843
                        - 37.3244
                      - - -121.86836
                        - 37.32443
                      - - -121.86831
                        - 37.32446
                      - - -121.86821
                        - 37.32451
                      - - -121.86785
                        - 37.32469
                      - - -121.86783
                        - 37.3247
                      - - -121.86775
                        - 37.32474
                      - - -121.86761
                        - 37.32475
                      - - -121.86714
                        - 37.32496
                      - - -121.86706
                        - 37.325
                      - - -121.86669
                        - 37.32518
                      - - -121.8665
                        - 37.32527
                      - - -121.86642
                        - 37.32531
                      - - -121.86624
                        - 37.3254
                      - - -121.86578
                        - 37.32562
                      - - -121.86567
                        - 37.32568
                      - - -121.86567
                        - 37.32568
                      - - -121.86557
                        - 37.32573
                      - - -121.86551
                        - 37.32576
                      - - -121.86535
                        - 37.32583
                      - - -121.86502
                        - 37.32596
                      - - -121.86315
                        - 37.32666
                      - - -121.86175
                        - 37.32732
                      - - -121.86175
                        - 37.32732
                  distance: 12781
                  duration: 741
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8871193
                      - 37.390611
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8610066
                      - 37.3263062
                visited_destination: false
                timeline: []
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Disable Order
      description: Disable an order identified by the given order_handle. This will
        recompute the ETA by excluding this order in the route
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DisableOrderRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /visits/{visit_id}/attachments:
    post:
      parameters:
        - in: path
          name: visit_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AddAttachmentResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Visits
      summary: Add Attachment to Visit
      description: Add an attachment to a visit.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AddAttachmentRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/{worker_handle}/invite:
    post:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PostWorkerInviteResponse"
              example:
                worker_handle: james@ht.com
                link: https://hypertrack-logistics.app.link/wqepoifv8f34c
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Invite Worker
      description: Generate a HyperTrack app (`ORDERS` or `VISITS`) installation link
        to be shared with the worker
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PostWorkerInviteRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/webhooks:
    get:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: value
          description: String representation to fetch webhooks for. It can be comma
            separated list, each itemin list can be one of `assigned`,
            `started`, `first_eta`, `eta`, `eta_change`, `n_minutes_away`,
            `device_switched`, `disabled`, `enabled`, `updated`, `delayed`,
            `risk_updated`, `arrived`, `exited`, `completed`, `cancelled`. eg.
            `?value=eta,eta_change
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: from_time
          description: ISO 8601 datetime indicating the start time to be used for fetching
            webhooks
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: to_time
          description: ISO 8601 datetime indicating the end time to be used for fetching
            webhooks
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: Filter for fulfillment attempt number
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Token provided by our API to retrieve the next page of webhooks
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Number of webhooks to be sent in response
          schema:
            type: integer
            default: 50
            nullable: true
          required: false
        - in: query
          name: sort_direction
          description: Field to sort webhooks by time in ascending or descending order
          schema:
            default: desc
            enum:
              - desc
              - asc
            nullable: true
          required: false
        - in: query
          name: debug_level
          description: Hidden parameter to enable internal debug level logging for webhook
            queries
          schema:
            type: string
            default: ""
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetOrderWebhooksResponse"
              example:
                webhooks:
                  - account_id: "80858940089"
                    device_id: 52193948-1A79-14GF-AB81-2FB0A59536S3
                    worker_handle: Samual-Jackson
                    type: order
                    data:
                      value: arrived
                      order_handle: ORD_6920
                      route_handle: a3f6e79c-c830-4766-8a3d-9eeaa5099ce2
                      place_handle: WARE_593
                      status: ongoing
                      share_url: https://trck.at/PvR4MmWOpt
                      scheduled_at: 2024-11-23T18:45:00.000Z
                      initial_eta: 2024-11-23T18:25:00.000Z
                      arrival:
                        location:
                          type: Point
                          coordinates:
                            - -121.9007247
                            - 37.3811932
                        recorded_at: 2024-11-23T18:35:00.000Z
                      metadata:
                        source: app
                        team_id: 4retro
                pagination_token: hjbkshkcvhskdjckdnk
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Order Webhooks
      description: API to fetch webhooks sent for an order
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/complete:
    post:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: type
          description: Type of the order which can be `drop` or `pick`
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: type_index
          description: Integer representing the `pick` or `drop` order index when having a
            pick/drop scenario
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: The attempt number for fulfilling the order
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompleteOrderResponse"
              example:
                order_handle: order-1
                fulfillment_attempt: 0
                status: completed
                destination:
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8871193
                      - 37.390611
                  address: 1709 Automation Pkwy, San Jose, CA 95101
                  radius: 100
                ops_group_handle: store-SF
                track_mode: on_time
                plan_mode: manual
                risk_status: true
                risks:
                  is_offline: green
                  moving_away_from_destination: green
                  delayed_from_scheduled_at: green
                  deviating_from_expected_route: green
                  in_outage: green
                  moving_too_slow: yellow
                  delayed_from_initial_eta: green
                  in_low_battery: green
                scheduled_at: 2023-10-26T02:00:00.000Z
                started_at: 2023-10-26T01:28:21.925Z
                type: pick
                type_index: 0
                expected_service_time: 0
                actual_service_time: 0
                tracked_service_time: 0
                capacity_used: 1
                metadata:
                  customerID: "12654"
                region:
                  country: United States
                  city: San Jose
                  state: California
                share_url: https://trck.at/xvgK2DRQvl
                completed_at: 2023-10-26T01:39:45.503Z
                device_id: 52193948-1A79-47CC-AB81-2FB0A59536D1
                worker_handle: James
                created_at: 2023-10-25T17:54:42.233Z
                assigned_at: 2023-10-25T18:08:44.892Z
                route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                planned_at: 2023-10-25T18:08:44.659Z
                plan_id: 0f3415f2-63b7-4727-83d2-010e88b48715
                distance: 0
                duration: 21
                tracking_rate: 0
                polyline:
                  type: LineString
                  coordinates:
                    - - -121.877246
                      - 37.371916
                      - 24.49
                      - 2023-10-26T01:39:24.125Z
                start_location:
                  type: Point
                  coordinates:
                    - -121.877246
                    - 37.371916
                end_location:
                  type: Point
                  coordinates:
                    - -121.877246
                    - 37.371916
                visited_destination: false
                completed_at_destination: false
                deviation_from_destination: 2254
                timeline:
                  - type: order_created
                    recorded_at: 2023-10-25T17:54:42.233Z
                    order_handle: order-1
                    metadata:
                      customerID: "12654"
                  - type: order_planned
                    recorded_at: 2023-10-25T18:08:44.659Z
                    order_handle: order-1
                    route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                    fulfillment_attempt: 0
                  - type: order_assigned
                    recorded_at: 2023-10-25T18:08:44.892Z
                    order_handle: order-1
                    driver_handle: James
                    fulfillment_attempt: 0
                  - type: order_started
                    recorded_at: 2023-10-26T01:28:21.925Z
                    order_handle: order-1
                    route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                    order_type: pick
                    fulfillment_attempt: 0
                  - type: driver_activity_started
                    recorded_at: 2023-10-26T01:39:24.125Z
                    driver_handle: null
                    activity: stop
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.877246
                          - 37.371916
                      recorded_at: 2023-10-26T01:39:24.125Z
                    address: 1653, De Rome Drive, San Jose, Santa Clara County, California, 95131,
                      United States
                  - type: driver_activity_ended
                    recorded_at: 2023-10-26T01:39:24.125Z
                    driver_handle: null
                    activity: stop
                    location:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.877246
                          - 37.371916
                      recorded_at: 2023-10-26T01:39:24.125Z
                    distance: null
                    duration: 0
                    steps: 0
                  - type: order_completed
                    recorded_at: 2023-10-26T01:39:45.503Z
                    order_handle: order-1
                    route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                    order_type: pick
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Complete Order
      description: Complete an order identified by the given order_handle
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CompleteOrderRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/reassign:
    post:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: type
          description: Type of the order which can be `drop` or `pick`
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: type_index
          description: Integer representing the `pick` or `drop` order index when having a
            pick/drop scenario
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: The attempt number for fulfilling the order
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReassignOrderResponse"
              example:
                order_handle: order-1
                fulfillment_attempt: 0
                status: assigned
                destination:
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8871193
                      - 37.390611
                  address: 1709 Automation Pkwy, San Jose, CA 95101
                  radius: 100
                ops_group_handle: store-SF
                track_mode: on_time
                plan_mode: manual
                scheduled_at: 2023-10-26T02:00:00.000Z
                type: pick
                type_index: 0
                expected_service_time: 0
                capacity_used: 1
                metadata:
                  customerID: "12654"
                region:
                  country: United States
                  city: San Jose
                  state: California
                device_id: 2CDAA567-8590-4326-8190-1C78ED663B26
                worker_handle: Smith
                created_at: 2023-10-25T17:54:42.233Z
                assigned_at: 2023-10-25T18:08:44.892Z
                route_handle: 812a1ea5-8c1e-407a-ba24-6cc46d783fef
                planned_at: 2023-10-25T18:08:44.659Z
                plan_id: 0f3415f2-63b7-4727-83d2-010e88b48715
                estimate:
                  start_by: 2023-10-26T00:57:48.000Z
                  arrive_at: 2023-10-25T19:10:57.324Z
                  polyline:
                    type: LineString
                    coordinates:
                      - - -122.42822
                        - 37.75934
                      - - -122.42817
                        - 37.7589
                      - - -122.4281
                        - 37.7582
                      - - -122.4281
                        - 37.75817
                      - - -122.42807
                        - 37.75809
                      - - -122.42807
                        - 37.75809
                      - - -122.42795
                        - 37.7581
                      - - -122.4279
                        - 37.7581
                      - - -122.42785
                        - 37.75811
                      - - -122.4278
                        - 37.75811
                      - - -122.42779
                        - 37.75811
                      - - -122.4274
                        - 37.75813
                      - - -122.42722
                        - 37.75815
                      - - -122.42653
                        - 37.75819
                      - - -122.42596
                        - 37.75822
                      - - -122.42586
                        - 37.75823
                      - - -122.42586
                        - 37.75823
                      - - -122.42585
                        - 37.75816
                      - - -122.42579
                        - 37.75751
                      - - -122.42578
                        - 37.75743
                      - - -122.42578
                        - 37.75737
                      - - -122.42571
                        - 37.75672
                      - - -122.42571
                        - 37.75671
                      - - -122.4257
                        - 37.75663
                      - - -122.4257
                        - 37.75657
                      - - -122.42563
                        - 37.75583
                      - - -122.42556
                        - 37.75511
                      - - -122.42555
                        - 37.75503
                      - - -122.42554
                        - 37.75497
                      - - -122.4254
                        - 37.75343
                      - - -122.42534
                        - 37.7528
                      - - -122.42532
                        - 37.75264
                      - - -122.4253
                        - 37.75242
                      - - -122.42524
                        - 37.75184
                      - - -122.42517
                        - 37.75103
                      - - -122.4251
                        - 37.75032
                      - - -122.42509
                        - 37.75024
                      - - -122.42501
                        - 37.74943
                      - - -122.42494
                        - 37.74872
                      - - -122.42494
                        - 37.74863
                      - - -122.42487
                        - 37.74792
                      - - -122.42486
                        - 37.74784
                      - - -122.42486
                        - 37.74784
                      - - -122.42471
                        - 37.74785
                      - - -122.42463
                        - 37.74785
                      - - -122.42382
                        - 37.7479
                      - - -122.42367
                        - 37.74791
                      - - -122.42305
                        - 37.74794
                      - - -122.42275
                        - 37.74795
                      - - -122.42264
                        - 37.74794
                      - - -122.42253
                        - 37.74794
                      - - -122.42242
                        - 37.74795
                      - - -122.4223
                        - 37.74796
                      - - -122.4214
                        - 37.74803
                      - - -122.42124
                        - 37.74804
                      - - -122.42116
                        - 37.74804
                      - - -122.42099
                        - 37.74805
                      - - -122.42078
                        - 37.74806
                      - - -122.42044
                        - 37.74806
                      - - -122.42029
                        - 37.74806
                      - - -122.42017
                        - 37.74806
                      - - -122.41993
                        - 37.74807
                      - - -122.41979
                        - 37.74807
                      - - -122.41845
                        - 37.7481
                      - - -122.41828
                        - 37.7481
                      - - -122.41815
                        - 37.7481
                      - - -122.418
                        - 37.74811
                      - - -122.41766
                        - 37.74811
                      - - -122.41749
                        - 37.74812
                      - - -122.41742
                        - 37.74812
                      - - -122.41737
                        - 37.74813
                      - - -122.41713
                        - 37.74814
                      - - -122.4166
                        - 37.74815
                      - - -122.41604
                        - 37.74816
                      - - -122.41588
                        - 37.74817
                      - - -122.41577
                        - 37.74817
                      - - -122.41503
                        - 37.74818
                      - - -122.41494
                        - 37.74819
                      - - -122.41485
                        - 37.74819
                      - - -122.4142
                        - 37.7482
                      - - -122.41418
                        - 37.7482
                      - - -122.41414
                        - 37.74821
                      - - -122.41407
                        - 37.74821
                      - - -122.41388
                        - 37.74821
                      - - -122.41382
                        - 37.74821
                      - - -122.41368
                        - 37.74821
                      - - -122.41357
                        - 37.74822
                      - - -122.41206
                        - 37.74825
                      - - -122.41166
                        - 37.74826
                      - - -122.41163
                        - 37.74826
                      - - -122.4115
                        - 37.74826
                      - - -122.41137
                        - 37.74826
                      - - -122.41097
                        - 37.74827
                      - - -122.41065
                        - 37.74828
                      - - -122.41056
                        - 37.74828
                      - - -122.41048
                        - 37.74828
                      - - -122.41008
                        - 37.74829
                      - - -122.4098
                        - 37.7483
                      - - -122.40975
                        - 37.7483
                      - - -122.40966
                        - 37.7483
                      - - -122.40958
                        - 37.7483
                      - - -122.40916
                        - 37.74831
                      - - -122.40904
                        - 37.74831
                      - - -122.40884
                        - 37.74831
                      - - -122.40872
                        - 37.74831
                      - - -122.4086
                        - 37.7483
                      - - -122.40816
                        - 37.74831
                      - - -122.40804
                        - 37.74832
                      - - -122.4079
                        - 37.74833
                      - - -122.40776
                        - 37.74837
                      - - -122.4076
                        - 37.74843
                      - - -122.40675
                        - 37.74872
                      - - -122.40646
                        - 37.74881
                      - - -122.40641
                        - 37.74882
                      - - -122.40639
                        - 37.74883
                      - - -122.40639
                        - 37.74883
                      - - -122.4062
                        - 37.74883
                      - - -122.40606
                        - 37.74883
                      - - -122.40559
                        - 37.74882
                      - - -122.40542
                        - 37.7488
                      - - -122.40528
                        - 37.74877
                      - - -122.40518
                        - 37.74875
                      - - -122.40508
                        - 37.74871
                      - - -122.40495
                        - 37.74866
                      - - -122.40483
                        - 37.7486
                      - - -122.40461
                        - 37.74849
                      - - -122.40457
                        - 37.74844
                      - - -122.40452
                        - 37.74839
                      - - -122.40448
                        - 37.74833
                      - - -122.40445
                        - 37.74826
                      - - -122.40443
                        - 37.74819
                      - - -122.40442
                        - 37.74813
                      - - -122.40442
                        - 37.74807
                      - - -122.40442
                        - 37.74801
                      - - -122.40443
                        - 37.74795
                      - - -122.40458
                        - 37.7474
                      - - -122.40459
                        - 37.74729
                      - - -122.40461
                        - 37.74693
                      - - -122.40461
                        - 37.74693
                      - - -122.40508
                        - 37.74539
                      - - -122.40517
                        - 37.74515
                      - - -122.40526
                        - 37.74489
                      - - -122.40537
                        - 37.74464
                      - - -122.40548
                        - 37.74441
                      - - -122.40563
                        - 37.74416
                      - - -122.40579
                        - 37.74394
                      - - -122.40597
                        - 37.74371
                      - - -122.40684
                        - 37.74267
                      - - -122.40694
                        - 37.74255
                      - - -122.40703
                        - 37.74243
                      - - -122.40721
                        - 37.74219
                      - - -122.40737
                        - 37.74194
                      - - -122.40751
                        - 37.7417
                      - - -122.40764
                        - 37.74145
                      - - -122.40776
                        - 37.74118
                      - - -122.40785
                        - 37.74094
                      - - -122.40793
                        - 37.74065
                      - - -122.408
                        - 37.74039
                      - - -122.40806
                        - 37.74011
                      - - -122.4081
                        - 37.73983
                      - - -122.40814
                        - 37.73947
                      - - -122.40816
                        - 37.73921
                      - - -122.40815
                        - 37.73895
                      - - -122.40814
                        - 37.73868
                      - - -122.40812
                        - 37.73842
                      - - -122.40809
                        - 37.73815
                      - - -122.40804
                        - 37.73792
                      - - -122.40798
                        - 37.73766
                      - - -122.40791
                        - 37.7374
                      - - -122.40782
                        - 37.73713
                      - - -122.40773
                        - 37.73688
                      - - -122.40763
                        - 37.73665
                      - - -122.40753
                        - 37.73643
                      - - -122.40741
                        - 37.73619
                      - - -122.40726
                        - 37.73592
                      - - -122.40716
                        - 37.73574
                      - - -122.40704
                        - 37.73555
                      - - -122.40615
                        - 37.73401
                      - - -122.40567
                        - 37.73319
                      - - -122.40552
                        - 37.73296
                      - - -122.4052
                        - 37.73244
                      - - -122.40502
                        - 37.73214
                      - - -122.40485
                        - 37.73183
                      - - -122.40465
                        - 37.73145
                      - - -122.4045
                        - 37.73116
                      - - -122.40433
                        - 37.73081
                      - - -122.40409
                        - 37.73031
                      - - -122.404
                        - 37.73011
                      - - -122.4038
                        - 37.72969
                      - - -122.40363
                        - 37.72931
                      - - -122.40348
                        - 37.72892
                      - - -122.40328
                        - 37.72845
                      - - -122.40303
                        - 37.72788
                      - - -122.40297
                        - 37.72772
                      - - -122.40248
                        - 37.7266
                      - - -122.40203
                        - 37.72542
                      - - -122.40148
                        - 37.72399
                      - - -122.40144
                        - 37.7239
                      - - -122.40127
                        - 37.72349
                      - - -122.40069
                        - 37.72209
                      - - -122.4005
                        - 37.72158
                      - - -122.40015
                        - 37.72057
                      - - -122.40011
                        - 37.72045
                      - - -122.40009
                        - 37.72039
                      - - -122.39983
                        - 37.71948
                      - - -122.39964
                        - 37.71876
                      - - -122.39957
                        - 37.71853
                      - - -122.39919
                        - 37.71711
                      - - -122.39916
                        - 37.71697
                      - - -122.39912
                        - 37.71685
                      - - -122.39908
                        - 37.71673
                      - - -122.39903
                        - 37.7166
                      - - -122.39898
                        - 37.71647
                      - - -122.39893
                        - 37.71634
                      - - -122.39887
                        - 37.71622
                      - - -122.39881
                        - 37.7161
                      - - -122.39875
                        - 37.71597
                      - - -122.39869
                        - 37.71585
                      - - -122.39862
                        - 37.71574
                      - - -122.39855
                        - 37.71561
                      - - -122.39848
                        - 37.71549
                      - - -122.3984
                        - 37.71537
                      - - -122.39833
                        - 37.71526
                      - - -122.39824
                        - 37.71514
                      - - -122.39816
                        - 37.71503
                      - - -122.39807
                        - 37.71491
                      - - -122.39798
                        - 37.7148
                      - - -122.39761
                        - 37.71436
                      - - -122.39706
                        - 37.7137
                      - - -122.39697
                        - 37.71359
                      - - -122.39688
                        - 37.71348
                      - - -122.39679
                        - 37.71336
                      - - -122.3967
                        - 37.71325
                      - - -122.39662
                        - 37.71313
                      - - -122.39655
                        - 37.71301
                      - - -122.39647
                        - 37.71289
                      - - -122.3964
                        - 37.71277
                      - - -122.39633
                        - 37.71266
                      - - -122.39626
                        - 37.71253
                      - - -122.3962
                        - 37.71241
                      - - -122.39614
                        - 37.71229
                      - - -122.39608
                        - 37.71216
                      - - -122.39603
                        - 37.71204
                      - - -122.39598
                        - 37.71191
                      - - -122.39593
                        - 37.71179
                      - - -122.39589
                        - 37.71166
                      - - -122.39584
                        - 37.71153
                      - - -122.39581
                        - 37.71141
                      - - -122.39577
                        - 37.71127
                      - - -122.39574
                        - 37.71114
                      - - -122.39572
                        - 37.71108
                      - - -122.39564
                        - 37.71074
                      - - -122.39556
                        - 37.71036
                      - - -122.39535
                        - 37.70945
                      - - -122.39523
                        - 37.70891
                      - - -122.39512
                        - 37.70844
                      - - -122.39509
                        - 37.70826
                      - - -122.39509
                        - 37.70826
                      - - -122.39502
                        - 37.70793
                      - - -122.39498
                        - 37.70777
                      - - -122.39491
                        - 37.70741
                      - - -122.3948
                        - 37.70689
                      - - -122.3947
                        - 37.70638
                      - - -122.39459
                        - 37.70586
                      - - -122.39447
                        - 37.70534
                      - - -122.39409
                        - 37.70367
                      - - -122.39345
                        - 37.70083
                      - - -122.39281
                        - 37.69799
                      - - -122.39208
                        - 37.69476
                      - - -122.39179
                        - 37.69348
                      - - -122.39116
                        - 37.69064
                      - - -122.39104
                        - 37.69012
                      - - -122.39072
                        - 37.6887
                      - - -122.38941
                        - 37.6829
                      - - -122.38929
                        - 37.68238
                      - - -122.38918
                        - 37.68187
                      - - -122.38905
                        - 37.68135
                      - - -122.38892
                        - 37.68084
                      - - -122.38879
                        - 37.68032
                      - - -122.38873
                        - 37.68007
                      - - -122.38867
                        - 37.67981
                      - - -122.38862
                        - 37.67955
                      - - -122.38857
                        - 37.67929
                      - - -122.38854
                        - 37.67903
                      - - -122.38851
                        - 37.67877
                      - - -122.3885
                        - 37.67852
                      - - -122.38849
                        - 37.67825
                      - - -122.3885
                        - 37.67799
                      - - -122.38852
                        - 37.67773
                      - - -122.38854
                        - 37.67747
                      - - -122.38858
                        - 37.67721
                      - - -122.38863
                        - 37.67695
                      - - -122.38869
                        - 37.67669
                      - - -122.38875
                        - 37.67645
                      - - -122.38883
                        - 37.67619
                      - - -122.38892
                        - 37.67594
                      - - -122.38902
                        - 37.67569
                      - - -122.38913
                        - 37.67544
                      - - -122.38919
                        - 37.67528
                      - - -122.38924
                        - 37.67518
                      - - -122.38935
                        - 37.67494
                      - - -122.38947
                        - 37.6747
                      - - -122.38959
                        - 37.67445
                      - - -122.38972
                        - 37.6742
                      - - -122.38985
                        - 37.67396
                      - - -122.38993
                        - 37.67381
                      - - -122.39
                        - 37.67369
                      - - -122.39013
                        - 37.67345
                      - - -122.39028
                        - 37.67322
                      - - -122.39042
                        - 37.67298
                      - - -122.39058
                        - 37.67273
                      - - -122.39072
                        - 37.67251
                      - - -122.39088
                        - 37.67228
                      - - -122.39104
                        - 37.67205
                      - - -122.39121
                        - 37.67182
                      - - -122.39129
                        - 37.6717
                      - - -122.39137
                        - 37.6716
                      - - -122.39154
                        - 37.67138
                      - - -122.39172
                        - 37.67116
                      - - -122.39189
                        - 37.67094
                      - - -122.39208
                        - 37.67072
                      - - -122.39226
                        - 37.6705
                      - - -122.39245
                        - 37.67028
                      - - -122.39264
                        - 37.67007
                      - - -122.39284
                        - 37.66986
                      - - -122.39304
                        - 37.66965
                      - - -122.39514
                        - 37.66747
                      - - -122.39582
                        - 37.66676
                      - - -122.39636
                        - 37.66618
                      - - -122.39656
                        - 37.66598
                      - - -122.39675
                        - 37.66578
                      - - -122.39696
                        - 37.66558
                      - - -122.39717
                        - 37.66538
                      - - -122.39741
                        - 37.66516
                      - - -122.39762
                        - 37.66498
                      - - -122.39785
                        - 37.66479
                      - - -122.39809
                        - 37.6646
                      - - -122.39831
                        - 37.66443
                      - - -122.39855
                        - 37.66425
                      - - -122.39879
                        - 37.66408
                      - - -122.39904
                        - 37.66391
                      - - -122.3993
                        - 37.66373
                      - - -122.39955
                        - 37.66357
                      - - -122.39982
                        - 37.6634
                      - - -122.40264
                        - 37.66159
                      - - -122.4029
                        - 37.66143
                      - - -122.40317
                        - 37.66124
                      - - -122.40341
                        - 37.66105
                      - - -122.40366
                        - 37.66086
                      - - -122.40393
                        - 37.66062
                      - - -122.40415
                        - 37.66041
                      - - -122.40437
                        - 37.66018
                      - - -122.40459
                        - 37.65992
                      - - -122.40477
                        - 37.6597
                      - - -122.40494
                        - 37.65947
                      - - -122.40508
                        - 37.65925
                      - - -122.40523
                        - 37.65901
                      - - -122.40536
                        - 37.65877
                      - - -122.40549
                        - 37.65852
                      - - -122.40573
                        - 37.65805
                      - - -122.40637
                        - 37.65681
                      - - -122.40649
                        - 37.65656
                      - - -122.40661
                        - 37.6563
                      - - -122.40671
                        - 37.65604
                      - - -122.4068
                        - 37.65578
                      - - -122.40688
                        - 37.65551
                      - - -122.40696
                        - 37.65523
                      - - -122.40701
                        - 37.65499
                      - - -122.40705
                        - 37.65473
                      - - -122.40709
                        - 37.65449
                      - - -122.40712
                        - 37.65423
                      - - -122.40713
                        - 37.65398
                      - - -122.40714
                        - 37.65373
                      - - -122.40714
                        - 37.65345
                      - - -122.40714
                        - 37.6532
                      - - -122.40712
                        - 37.65292
                      - - -122.40703
                        - 37.65185
                      - - -122.40699
                        - 37.65145
                      - - -122.40688
                        - 37.65013
                      - - -122.40685
                        - 37.64982
                      - - -122.40677
                        - 37.64892
                      - - -122.40673
                        - 37.64849
                      - - -122.40668
                        - 37.64782
                      - - -122.40636
                        - 37.64425
                      - - -122.40623
                        - 37.64277
                      - - -122.40621
                        - 37.64248
                      - - -122.40618
                        - 37.64217
                      - - -122.40617
                        - 37.64204
                      - - -122.40616
                        - 37.6419
                      - - -122.40613
                        - 37.64174
                      - - -122.40611
                        - 37.6416
                      - - -122.40609
                        - 37.64146
                      - - -122.40607
                        - 37.6413
                      - - -122.40604
                        - 37.64115
                      - - -122.40601
                        - 37.64101
                      - - -122.40598
                        - 37.64087
                      - - -122.40595
                        - 37.64073
                      - - -122.40591
                        - 37.64057
                      - - -122.40587
                        - 37.64042
                      - - -122.40583
                        - 37.64028
                      - - -122.40579
                        - 37.64014
                      - - -122.40574
                        - 37.63999
                      - - -122.40569
                        - 37.63984
                      - - -122.40565
                        - 37.63971
                      - - -122.4056
                        - 37.63958
                      - - -122.40554
                        - 37.63942
                      - - -122.40548
                        - 37.63928
                      - - -122.40543
                        - 37.63914
                      - - -122.40537
                        - 37.639
                      - - -122.40531
                        - 37.63885
                      - - -122.40524
                        - 37.63871
                      - - -122.40518
                        - 37.63858
                      - - -122.40511
                        - 37.63844
                      - - -122.40505
                        - 37.6383
                      - - -122.40497
                        - 37.63816
                      - - -122.4049
                        - 37.63802
                      - - -122.40432
                        - 37.63694
                      - - -122.40425
                        - 37.6368
                      - - -122.40418
                        - 37.63667
                      - - -122.40412
                        - 37.63654
                      - - -122.40406
                        - 37.63643
                      - - -122.404
                        - 37.63629
                      - - -122.40395
                        - 37.63618
                      - - -122.40389
                        - 37.63605
                      - - -122.40384
                        - 37.63593
                      - - -122.40379
                        - 37.6358
                      - - -122.40373
                        - 37.63566
                      - - -122.40368
                        - 37.63553
                      - - -122.40364
                        - 37.63541
                      - - -122.4036
                        - 37.63529
                      - - -122.40355
                        - 37.63516
                      - - -122.40351
                        - 37.63503
                      - - -122.40347
                        - 37.6349
                      - - -122.40343
                        - 37.63477
                      - - -122.40339
                        - 37.63464
                      - - -122.40335
                        - 37.63451
                      - - -122.40332
                        - 37.63438
                      - - -122.40329
                        - 37.63425
                      - - -122.40325
                        - 37.63411
                      - - -122.40322
                        - 37.63397
                      - - -122.40319
                        - 37.63384
                      - - -122.40317
                        - 37.63373
                      - - -122.40314
                        - 37.63357
                      - - -122.40311
                        - 37.6334
                      - - -122.40309
                        - 37.63327
                      - - -122.40306
                        - 37.63309
                      - - -122.40305
                        - 37.63295
                      - - -122.40303
                        - 37.63281
                      - - -122.40291
                        - 37.63176
                      - - -122.40281
                        - 37.63089
                      - - -122.40264
                        - 37.62941
                      - - -122.40262
                        - 37.62924
                      - - -122.40261
                        - 37.62911
                      - - -122.40259
                        - 37.62896
                      - - -122.40257
                        - 37.62881
                      - - -122.40254
                        - 37.62867
                      - - -122.40252
                        - 37.62851
                      - - -122.40249
                        - 37.62837
                      - - -122.40247
                        - 37.62822
                      - - -122.40244
                        - 37.62809
                      - - -122.4024
                        - 37.62794
                      - - -122.40237
                        - 37.62779
                      - - -122.40233
                        - 37.62764
                      - - -122.4023
                        - 37.6275
                      - - -122.40226
                        - 37.62737
                      - - -122.40221
                        - 37.62721
                      - - -122.40217
                        - 37.62708
                      - - -122.40213
                        - 37.62693
                      - - -122.40208
                        - 37.62679
                      - - -122.40203
                        - 37.62663
                      - - -122.40198
                        - 37.62649
                      - - -122.40177
                        - 37.62588
                      - - -122.40152
                        - 37.62512
                      - - -122.40142
                        - 37.6248
                      - - -122.40132
                        - 37.62449
                      - - -122.40034
                        - 37.62158
                      - - -122.39987
                        - 37.62018
                      - - -122.39895
                        - 37.61747
                      - - -122.39874
                        - 37.61685
                      - - -122.3987
                        - 37.61672
                      - - -122.39866
                        - 37.61661
                      - - -122.39862
                        - 37.61649
                      - - -122.39857
                        - 37.61636
                      - - -122.39851
                        - 37.61621
                      - - -122.3984
                        - 37.61597
                      - - -122.39828
                        - 37.61573
                      - - -122.39816
                        - 37.61549
                      - - -122.39802
                        - 37.61525
                      - - -122.39788
                        - 37.61502
                      - - -122.39773
                        - 37.61478
                      - - -122.39757
                        - 37.61455
                      - - -122.3974
                        - 37.61432
                      - - -122.39723
                        - 37.61409
                      - - -122.39705
                        - 37.61387
                      - - -122.39687
                        - 37.61365
                      - - -122.39667
                        - 37.61343
                      - - -122.39646
                        - 37.61321
                      - - -122.39625
                        - 37.613
                      - - -122.39605
                        - 37.6128
                      - - -122.39583
                        - 37.6126
                      - - -122.3956
                        - 37.61241
                      - - -122.39539
                        - 37.61223
                      - - -122.39517
                        - 37.61205
                      - - -122.39493
                        - 37.61187
                      - - -122.39469
                        - 37.61169
                      - - -122.39446
                        - 37.61153
                      - - -122.39419
                        - 37.61135
                      - - -122.39392
                        - 37.61118
                      - - -122.39366
                        - 37.61101
                      - - -122.3934
                        - 37.61084
                      - - -122.39315
                        - 37.61068
                      - - -122.39289
                        - 37.61052
                      - - -122.39261
                        - 37.61035
                      - - -122.39236
                        - 37.61019
                      - - -122.3921
                        - 37.61003
                      - - -122.39184
                        - 37.60986
                      - - -122.39158
                        - 37.60969
                      - - -122.39133
                        - 37.60953
                      - - -122.38933
                        - 37.60822
                      - - -122.38864
                        - 37.60779
                      - - -122.38749
                        - 37.60704
                      - - -122.3848
                        - 37.60529
                      - - -122.38352
                        - 37.60445
                      - - -122.38187
                        - 37.6034
                      - - -122.37853
                        - 37.60121
                      - - -122.3765
                        - 37.59988
                      - - -122.37547
                        - 37.59921
                      - - -122.37425
                        - 37.59842
                      - - -122.37393
                        - 37.59822
                      - - -122.37367
                        - 37.59805
                      - - -122.37342
                        - 37.59789
                      - - -122.37316
                        - 37.59772
                      - - -122.37291
                        - 37.59756
                      - - -122.37265
                        - 37.5974
                      - - -122.37239
                        - 37.59723
                      - - -122.36882
                        - 37.59489
                      - - -122.3673
                        - 37.5939
                      - - -122.36538
                        - 37.59265
                      - - -122.36098
                        - 37.58976
                      - - -122.36072
                        - 37.5896
                      - - -122.36047
                        - 37.58943
                      - - -122.36022
                        - 37.58927
                      - - -122.35996
                        - 37.58912
                      - - -122.3597
                        - 37.58897
                      - - -122.35943
                        - 37.58882
                      - - -122.35915
                        - 37.58869
                      - - -122.35887
                        - 37.58856
                      - - -122.35858
                        - 37.58843
                      - - -122.35829
                        - 37.58831
                      - - -122.35799
                        - 37.5882
                      - - -122.3577
                        - 37.58809
                      - - -122.3574
                        - 37.58799
                      - - -122.3571
                        - 37.58789
                      - - -122.35679
                        - 37.5878
                      - - -122.35648
                        - 37.58771
                      - - -122.35616
                        - 37.58762
                      - - -122.35584
                        - 37.58755
                      - - -122.35552
                        - 37.58748
                      - - -122.35521
                        - 37.58741
                      - - -122.35487
                        - 37.58736
                      - - -122.35455
                        - 37.58731
                      - - -122.35423
                        - 37.58726
                      - - -122.35389
                        - 37.58722
                      - - -122.35356
                        - 37.58719
                      - - -122.35324
                        - 37.58717
                      - - -122.35291
                        - 37.58715
                      - - -122.35257
                        - 37.58714
                      - - -122.35224
                        - 37.58713
                      - - -122.35191
                        - 37.58712
                      - - -122.35009
                        - 37.58707
                      - - -122.34843
                        - 37.58703
                      - - -122.34216
                        - 37.58687
                      - - -122.33835
                        - 37.58677
                      - - -122.33471
                        - 37.58668
                      - - -122.33454
                        - 37.58667
                      - - -122.33438
                        - 37.58667
                      - - -122.33421
                        - 37.58666
                      - - -122.33404
                        - 37.58665
                      - - -122.33388
                        - 37.58664
                      - - -122.33371
                        - 37.58663
                      - - -122.33355
                        - 37.58662
                      - - -122.3334
                        - 37.5866
                      - - -122.33324
                        - 37.58658
                      - - -122.33307
                        - 37.58655
                      - - -122.33291
                        - 37.58653
                      - - -122.33276
                        - 37.5865
                      - - -122.3326
                        - 37.58647
                      - - -122.33244
                        - 37.58643
                      - - -122.33228
                        - 37.58639
                      - - -122.33213
                        - 37.58635
                      - - -122.33197
                        - 37.58631
                      - - -122.33182
                        - 37.58626
                      - - -122.33167
                        - 37.58621
                      - - -122.33152
                        - 37.58615
                      - - -122.33137
                        - 37.5861
                      - - -122.33122
                        - 37.58604
                      - - -122.33108
                        - 37.58597
                      - - -122.33094
                        - 37.58591
                      - - -122.3308
                        - 37.58584
                      - - -122.33066
                        - 37.58577
                      - - -122.33052
                        - 37.5857
                      - - -122.33039
                        - 37.58562
                      - - -122.33026
                        - 37.58554
                      - - -122.33013
                        - 37.58546
                      - - -122.33
                        - 37.58537
                      - - -122.32988
                        - 37.58529
                      - - -122.32976
                        - 37.5852
                      - - -122.32964
                        - 37.58511
                      - - -122.32953
                        - 37.58502
                      - - -122.32942
                        - 37.58492
                      - - -122.32931
                        - 37.58482
                      - - -122.3292
                        - 37.58472
                      - - -122.32909
                        - 37.58463
                      - - -122.32898
                        - 37.58453
                      - - -122.32876
                        - 37.58432
                      - - -122.32855
                        - 37.58413
                      - - -122.32586
                        - 37.58166
                      - - -122.32297
                        - 37.579
                      - - -122.32212
                        - 37.57821
                      - - -122.32006
                        - 37.57631
                      - - -122.31674
                        - 37.57326
                      - - -122.31555
                        - 37.57216
                      - - -122.31082
                        - 37.56781
                      - - -122.30735
                        - 37.5646
                      - - -122.30397
                        - 37.56147
                      - - -122.30381
                        - 37.56132
                      - - -122.30356
                        - 37.56109
                      - - -122.30323
                        - 37.56079
                      - - -122.30275
                        - 37.56034
                      - - -122.30258
                        - 37.56019
                      - - -122.30222
                        - 37.55983
                      - - -122.30188
                        - 37.55946
                      - - -122.3015
                        - 37.55905
                      - - -122.30026
                        - 37.55761
                      - - -122.29981
                        - 37.55711
                      - - -122.2991
                        - 37.55635
                      - - -122.2983
                        - 37.5555
                      - - -122.29784
                        - 37.55499
                      - - -122.2973
                        - 37.55444
                      - - -122.29646
                        - 37.55358
                      - - -122.29605
                        - 37.55314
                      - - -122.29561
                        - 37.55267
                      - - -122.29366
                        - 37.55057
                      - - -122.29301
                        - 37.54988
                      - - -122.29217
                        - 37.54899
                      - - -122.29195
                        - 37.54874
                      - - -122.28939
                        - 37.54597
                      - - -122.28841
                        - 37.54494
                      - - -122.2878
                        - 37.54428
                      - - -122.28617
                        - 37.54251
                      - - -122.28567
                        - 37.54198
                      - - -122.28545
                        - 37.54174
                      - - -122.28522
                        - 37.54149
                      - - -122.28439
                        - 37.54056
                      - - -122.28386
                        - 37.53998
                      - - -122.28189
                        - 37.53786
                      - - -122.27851
                        - 37.5342
                      - - -122.27822
                        - 37.53389
                      - - -122.27644
                        - 37.53196
                      - - -122.27612
                        - 37.53161
                      - - -122.27579
                        - 37.53127
                      - - -122.27541
                        - 37.53088
                      - - -122.27505
                        - 37.53053
                      - - -122.27471
                        - 37.53021
                      - - -122.27434
                        - 37.52987
                      - - -122.27366
                        - 37.52921
                      - - -122.27315
                        - 37.52882
                      - - -122.26985
                        - 37.52592
                      - - -122.26664
                        - 37.52309
                      - - -122.26482
                        - 37.52148
                      - - -122.26476
                        - 37.52143
                      - - -122.26461
                        - 37.5213
                      - - -122.26263
                        - 37.51954
                      - - -122.262
                        - 37.51898
                      - - -122.26091
                        - 37.51803
                      - - -122.25943
                        - 37.51671
                      - - -122.25895
                        - 37.5163
                      - - -122.25829
                        - 37.51571
                      - - -122.25659
                        - 37.51421
                      - - -122.25598
                        - 37.51366
                      - - -122.25413
                        - 37.51203
                      - - -122.25218
                        - 37.51031
                      - - -122.25113
                        - 37.50936
                      - - -122.24772
                        - 37.50634
                      - - -122.24636
                        - 37.50514
                      - - -122.24495
                        - 37.5039
                      - - -122.24298
                        - 37.50216
                      - - -122.2415
                        - 37.50084
                      - - -122.24063
                        - 37.50008
                      - - -122.23994
                        - 37.49948
                      - - -122.23961
                        - 37.49921
                      - - -122.23928
                        - 37.49893
                      - - -122.23893
                        - 37.49867
                      - - -122.23855
                        - 37.49841
                      - - -122.23818
                        - 37.49818
                      - - -122.23778
                        - 37.49795
                      - - -122.23764
                        - 37.49787
                      - - -122.23753
                        - 37.49781
                      - - -122.23732
                        - 37.4977
                      - - -122.23684
                        - 37.49748
                      - - -122.23643
                        - 37.4973
                      - - -122.23602
                        - 37.49713
                      - - -122.23556
                        - 37.49697
                      - - -122.23512
                        - 37.49683
                      - - -122.23468
                        - 37.49669
                      - - -122.23191
                        - 37.49591
                      - - -122.22897
                        - 37.49507
                      - - -122.22797
                        - 37.49479
                      - - -122.22747
                        - 37.49465
                      - - -122.22695
                        - 37.4945
                      - - -122.22654
                        - 37.49437
                      - - -122.22614
                        - 37.49424
                      - - -122.22575
                        - 37.49411
                      - - -122.22522
                        - 37.49392
                      - - -122.2248
                        - 37.49377
                      - - -122.22434
                        - 37.49359
                      - - -122.2239
                        - 37.49342
                      - - -122.22346
                        - 37.49324
                      - - -122.22304
                        - 37.49305
                      - - -122.22259
                        - 37.49286
                      - - -122.21902
                        - 37.49127
                      - - -122.21892
                        - 37.49122
                      - - -122.21714
                        - 37.49043
                      - - -122.2167
                        - 37.49024
                      - - -122.21626
                        - 37.49005
                      - - -122.21582
                        - 37.48987
                      - - -122.21537
                        - 37.4897
                      - - -122.2151
                        - 37.4896
                      - - -122.21492
                        - 37.48953
                      - - -122.21469
                        - 37.48945
                      - - -122.21447
                        - 37.48937
                      - - -122.21401
                        - 37.48921
                      - - -122.2136
                        - 37.48908
                      - - -122.2133
                        - 37.48898
                      - - -122.21316
                        - 37.48894
                      - - -122.21266
                        - 37.48879
                      - - -122.21232
                        - 37.48869
                      - - -122.21184
                        - 37.48856
                      - - -122.21138
                        - 37.48844
                      - - -122.2109
                        - 37.48832
                      - - -122.21042
                        - 37.48821
                      - - -122.20995
                        - 37.4881
                      - - -122.20946
                        - 37.488
                      - - -122.20898
                        - 37.48791
                      - - -122.2085
                        - 37.48782
                      - - -122.20801
                        - 37.48774
                      - - -122.20752
                        - 37.48767
                      - - -122.20588
                        - 37.48746
                      - - -122.19052
                        - 37.48556
                      - - -122.19003
                        - 37.48549
                      - - -122.18951
                        - 37.48543
                      - - -122.18902
                        - 37.48536
                      - - -122.18853
                        - 37.48529
                      - - -122.18804
                        - 37.48521
                      - - -122.18756
                        - 37.48513
                      - - -122.18708
                        - 37.48504
                      - - -122.18659
                        - 37.48494
                      - - -122.18612
                        - 37.48484
                      - - -122.18563
                        - 37.48473
                      - - -122.18519
                        - 37.48463
                      - - -122.18472
                        - 37.48451
                      - - -122.18425
                        - 37.48439
                      - - -122.18377
                        - 37.48426
                      - - -122.18331
                        - 37.48413
                      - - -122.18285
                        - 37.48399
                      - - -122.18238
                        - 37.48385
                      - - -122.18192
                        - 37.4837
                      - - -122.18146
                        - 37.48354
                      - - -122.18101
                        - 37.48338
                      - - -122.18095
                        - 37.48334
                      - - -122.17925
                        - 37.48266
                      - - -122.17882
                        - 37.48246
                      - - -122.1784
                        - 37.48225
                      - - -122.17798
                        - 37.48203
                      - - -122.17758
                        - 37.4818
                      - - -122.17742
                        - 37.48169
                      - - -122.17114
                        - 37.47808
                      - - -122.16975
                        - 37.47728
                      - - -122.1664
                        - 37.47533
                      - - -122.15956
                        - 37.4713
                      - - -122.1584
                        - 37.47061
                      - - -122.15392
                        - 37.46798
                      - - -122.15342
                        - 37.4677
                      - - -122.15268
                        - 37.46728
                      - - -122.1509
                        - 37.46621
                      - - -122.14701
                        - 37.46393
                      - - -122.14452
                        - 37.46244
                      - - -122.14159
                        - 37.46075
                      - - -122.13725
                        - 37.4582
                      - - -122.13646
                        - 37.45774
                      - - -122.12802
                        - 37.45279
                      - - -122.12767
                        - 37.45258
                      - - -122.12735
                        - 37.45238
                      - - -122.12693
                        - 37.45211
                      - - -122.12646
                        - 37.45179
                      - - -122.12619
                        - 37.45159
                      - - -122.12583
                        - 37.45132
                      - - -122.12548
                        - 37.45104
                      - - -122.12515
                        - 37.45075
                      - - -122.12482
                        - 37.45045
                      - - -122.12142
                        - 37.44722
                      - - -122.11973
                        - 37.4456
                      - - -122.11897
                        - 37.44486
                      - - -122.11714
                        - 37.44314
                      - - -122.1142
                        - 37.44034
                      - - -122.11392
                        - 37.44008
                      - - -122.11373
                        - 37.43989
                      - - -122.11061
                        - 37.43691
                      - - -122.10556
                        - 37.4321
                      - - -122.10542
                        - 37.43197
                      - - -122.10404
                        - 37.43065
                      - - -122.10264
                        - 37.42932
                      - - -122.10137
                        - 37.42809
                      - - -122.0997
                        - 37.42651
                      - - -122.09928
                        - 37.42611
                      - - -122.09885
                        - 37.42571
                      - - -122.09843
                        - 37.42533
                      - - -122.09801
                        - 37.42497
                      - - -122.09753
                        - 37.42457
                      - - -122.09706
                        - 37.4242
                      - - -122.09646
                        - 37.42375
                      - - -122.09583
                        - 37.4233
                      - - -122.09264
                        - 37.42097
                      - - -122.09244
                        - 37.42082
                      - - -122.0905
                        - 37.41943
                      - - -122.08918
                        - 37.41848
                      - - -122.0864
                        - 37.41645
                      - - -122.08419
                        - 37.41485
                      - - -122.08393
                        - 37.41466
                      - - -122.0837
                        - 37.4145
                      - - -122.08344
                        - 37.41434
                      - - -122.08306
                        - 37.41409
                      - - -122.08266
                        - 37.41385
                      - - -122.08251
                        - 37.41377
                      - - -122.08225
                        - 37.41362
                      - - -122.08209
                        - 37.41351
                      - - -122.08143
                        - 37.4132
                      - - -122.08055
                        - 37.4128
                      - - -122.07882
                        - 37.41208
                      - - -122.07836
                        - 37.41189
                      - - -122.07782
                        - 37.41163
                      - - -122.07759
                        - 37.41154
                      - - -122.07633
                        - 37.41102
                      - - -122.07633
                        - 37.41102
                      - - -122.07592
                        - 37.41087
                      - - -122.0757
                        - 37.41078
                      - - -122.07504
                        - 37.41053
                      - - -122.07475
                        - 37.4104
                      - - -122.07407
                        - 37.41013
                      - - -122.07188
                        - 37.40923
                      - - -122.07095
                        - 37.40885
                      - - -122.07063
                        - 37.40873
                      - - -122.07029
                        - 37.4086
                      - - -122.06996
                        - 37.40848
                      - - -122.06963
                        - 37.40837
                      - - -122.0693
                        - 37.40826
                      - - -122.06894
                        - 37.40815
                      - - -122.06864
                        - 37.40807
                      - - -122.06831
                        - 37.40798
                      - - -122.06798
                        - 37.4079
                      - - -122.06761
                        - 37.40781
                      - - -122.06719
                        - 37.40771
                      - - -122.06617
                        - 37.4075
                      - - -122.06608
                        - 37.40748
                      - - -122.06596
                        - 37.40745
                      - - -122.0651
                        - 37.40726
                      - - -122.06371
                        - 37.40696
                      - - -122.05954
                        - 37.40605
                      - - -122.05662
                        - 37.40541
                      - - -122.05594
                        - 37.40525
                      - - -122.05524
                        - 37.40508
                      - - -122.05455
                        - 37.40489
                      - - -122.05249
                        - 37.40431
                      - - -122.0516
                        - 37.40408
                      - - -122.05095
                        - 37.40392
                      - - -122.05028
                        - 37.40377
                      - - -122.04965
                        - 37.40363
                      - - -122.04702
                        - 37.40305
                      - - -122.03846
                        - 37.40118
                      - - -122.03735
                        - 37.40094
                      - - -122.03607
                        - 37.40066
                      - - -122.03242
                        - 37.39989
                      - - -122.03192
                        - 37.39978
                      - - -122.03117
                        - 37.39961
                      - - -122.02779
                        - 37.39885
                      - - -122.02708
                        - 37.39869
                      - - -122.02481
                        - 37.3982
                      - - -122.01667
                        - 37.39642
                      - - -122.01298
                        - 37.39561
                      - - -122.01271
                        - 37.39554
                      - - -122.00884
                        - 37.3947
                      - - -122.00739
                        - 37.39435
                      - - -122.00453
                        - 37.39356
                      - - -121.9997
                        - 37.3922
                      - - -121.99829
                        - 37.39179
                      - - -121.99673
                        - 37.3913
                      - - -121.99415
                        - 37.39052
                      - - -121.9936
                        - 37.39036
                      - - -121.99252
                        - 37.39004
                      - - -121.99116
                        - 37.38965
                      - - -121.99032
                        - 37.38941
                      - - -121.98912
                        - 37.38907
                      - - -121.98752
                        - 37.38862
                      - - -121.98497
                        - 37.38791
                      - - -121.9831
                        - 37.3874
                      - - -121.9775
                        - 37.3858
                      - - -121.97484
                        - 37.38503
                      - - -121.97244
                        - 37.38434
                      - - -121.96954
                        - 37.38351
                      - - -121.96875
                        - 37.38328
                      - - -121.96843
                        - 37.3832
                      - - -121.96421
                        - 37.38199
                      - - -121.95991
                        - 37.38077
                      - - -121.95948
                        - 37.38064
                      - - -121.95857
                        - 37.38038
                      - - -121.95539
                        - 37.37948
                      - - -121.95397
                        - 37.37911
                      - - -121.95265
                        - 37.37881
                      - - -121.95132
                        - 37.37853
                      - - -121.94853
                        - 37.37798
                      - - -121.94648
                        - 37.37757
                      - - -121.94208
                        - 37.37672
                      - - -121.9414
                        - 37.37659
                      - - -121.93905
                        - 37.37613
                      - - -121.93552
                        - 37.37543
                      - - -121.93453
                        - 37.37522
                      - - -121.93389
                        - 37.37509
                      - - -121.93323
                        - 37.37494
                      - - -121.93264
                        - 37.37478
                      - - -121.93173
                        - 37.37458
                      - - -121.93097
                        - 37.3744
                      - - -121.92546
                        - 37.37307
                      - - -121.92431
                        - 37.3728
                      - - -121.92381
                        - 37.3727
                      - - -121.92295
                        - 37.37256
                      - - -121.92295
                        - 37.37256
                      - - -121.9227
                        - 37.37243
                      - - -121.92222
                        - 37.37233
                      - - -121.92188
                        - 37.37226
                      - - -121.92082
                        - 37.37205
                      - - -121.92055
                        - 37.37198
                      - - -121.92044
                        - 37.37196
                      - - -121.91994
                        - 37.37184
                      - - -121.91994
                        - 37.37184
                      - - -121.91975
                        - 37.37179
                      - - -121.91965
                        - 37.37187
                      - - -121.91892
                        - 37.37253
                      - - -121.91865
                        - 37.37277
                      - - -121.91838
                        - 37.37302
                      - - -121.91828
                        - 37.37311
                      - - -121.91822
                        - 37.37316
                      - - -121.91819
                        - 37.3732
                      - - -121.91812
                        - 37.37326
                      - - -121.91804
                        - 37.37333
                      - - -121.91757
                        - 37.37375
                      - - -121.91736
                        - 37.37393
                      - - -121.91717
                        - 37.3741
                      - - -121.91698
                        - 37.37424
                      - - -121.91676
                        - 37.37445
                      - - -121.91662
                        - 37.37459
                      - - -121.9162
                        - 37.37495
                      - - -121.91583
                        - 37.37528
                      - - -121.91554
                        - 37.37554
                      - - -121.91546
                        - 37.37561
                      - - -121.91516
                        - 37.37587
                      - - -121.91485
                        - 37.37614
                      - - -121.91455
                        - 37.37636
                      - - -121.91438
                        - 37.37647
                      - - -121.91406
                        - 37.37667
                      - - -121.91383
                        - 37.37682
                      - - -121.9138
                        - 37.37684
                      - - -121.91368
                        - 37.37691
                      - - -121.91345
                        - 37.37705
                      - - -121.9132
                        - 37.37722
                      - - -121.91315
                        - 37.37726
                      - - -121.91303
                        - 37.37734
                      - - -121.91299
                        - 37.37738
                      - - -121.9128
                        - 37.37751
                      - - -121.91222
                        - 37.37791
                      - - -121.91217
                        - 37.37794
                      - - -121.91179
                        - 37.37818
                      - - -121.9114
                        - 37.37843
                      - - -121.91124
                        - 37.37852
                      - - -121.91119
                        - 37.37856
                      - - -121.91103
                        - 37.37866
                      - - -121.91099
                        - 37.37868
                      - - -121.91066
                        - 37.37889
                      - - -121.91057
                        - 37.37895
                      - - -121.91052
                        - 37.37898
                      - - -121.9103
                        - 37.37912
                      - - -121.91017
                        - 37.37921
                      - - -121.91004
                        - 37.37929
                      - - -121.9098
                        - 37.37944
                      - - -121.90974
                        - 37.37948
                      - - -121.90938
                        - 37.37971
                      - - -121.90918
                        - 37.37983
                      - - -121.90911
                        - 37.37988
                      - - -121.90901
                        - 37.37994
                      - - -121.90868
                        - 37.38014
                      - - -121.90787
                        - 37.38066
                      - - -121.9075
                        - 37.3809
                      - - -121.90668
                        - 37.38141
                      - - -121.90648
                        - 37.38154
                      - - -121.90623
                        - 37.38169
                      - - -121.90613
                        - 37.38175
                      - - -121.90591
                        - 37.38187
                      - - -121.90562
                        - 37.38204
                      - - -121.90545
                        - 37.38209
                      - - -121.90528
                        - 37.38214
                      - - -121.90508
                        - 37.38217
                      - - -121.90481
                        - 37.38219
                      - - -121.9046
                        - 37.38218
                      - - -121.90438
                        - 37.38216
                      - - -121.90416
                        - 37.38212
                      - - -121.90393
                        - 37.38205
                      - - -121.90377
                        - 37.38199
                      - - -121.90362
                        - 37.38194
                      - - -121.90339
                        - 37.38185
                      - - -121.90316
                        - 37.38179
                      - - -121.9028
                        - 37.38171
                      - - -121.90265
                        - 37.38169
                      - - -121.9025
                        - 37.38169
                      - - -121.90231
                        - 37.38169
                      - - -121.90184
                        - 37.38175
                      - - -121.90155
                        - 37.38181
                      - - -121.9013
                        - 37.38189
                      - - -121.90118
                        - 37.38193
                      - - -121.90092
                        - 37.38203
                      - - -121.90067
                        - 37.38214
                      - - -121.90055
                        - 37.38221
                      - - -121.90043
                        - 37.38227
                      - - -121.90007
                        - 37.38244
                      - - -121.89962
                        - 37.38262
                      - - -121.89933
                        - 37.3827
                      - - -121.89931
                        - 37.3827
                      - - -121.89901
                        - 37.38276
                      - - -121.89886
                        - 37.38278
                      - - -121.89878
                        - 37.38279
                      - - -121.89857
                        - 37.38281
                      - - -121.89833
                        - 37.38281
                      - - -121.898
                        - 37.3828
                      - - -121.89732
                        - 37.38276
                      - - -121.89682
                        - 37.38272
                      - - -121.89651
                        - 37.3827
                      - - -121.89606
                        - 37.38268
                      - - -121.89594
                        - 37.38267
                      - - -121.89594
                        - 37.38267
                      - - -121.8957
                        - 37.38266
                      - - -121.89557
                        - 37.38265
                      - - -121.89523
                        - 37.38263
                      - - -121.8951
                        - 37.38263
                      - - -121.89491
                        - 37.38263
                      - - -121.89467
                        - 37.38264
                      - - -121.89446
                        - 37.38266
                      - - -121.8941
                        - 37.38272
                      - - -121.894
                        - 37.38274
                      - - -121.89384
                        - 37.38278
                      - - -121.89364
                        - 37.38284
                      - - -121.89343
                        - 37.38291
                      - - -121.89322
                        - 37.38299
                      - - -121.89309
                        - 37.38305
                      - - -121.89291
                        - 37.38314
                      - - -121.89274
                        - 37.38323
                      - - -121.89268
                        - 37.38327
                      - - -121.89264
                        - 37.38329
                      - - -121.89226
                        - 37.38352
                      - - -121.89216
                        - 37.38359
                      - - -121.89206
                        - 37.38364
                      - - -121.89091
                        - 37.38434
                      - - -121.89034
                        - 37.38469
                      - - -121.89023
                        - 37.38474
                      - - -121.89014
                        - 37.38482
                      - - -121.8881
                        - 37.38606
                      - - -121.88675
                        - 37.38686
                      - - -121.88639
                        - 37.38708
                      - - -121.88616
                        - 37.38722
                      - - -121.88608
                        - 37.38727
                      - - -121.88608
                        - 37.38727
                      - - -121.88595
                        - 37.38734
                      - - -121.88587
                        - 37.38739
                      - - -121.88568
                        - 37.38748
                      - - -121.88545
                        - 37.38756
                      - - -121.88521
                        - 37.38763
                      - - -121.885
                        - 37.38768
                      - - -121.88491
                        - 37.38769
                      - - -121.88475
                        - 37.38772
                      - - -121.8846
                        - 37.38773
                      - - -121.88429
                        - 37.38774
                      - - -121.88382
                        - 37.38773
                      - - -121.88368
                        - 37.38773
                      - - -121.88344
                        - 37.38774
                      - - -121.88325
                        - 37.38775
                      - - -121.88295
                        - 37.38779
                      - - -121.88267
                        - 37.38786
                      - - -121.88263
                        - 37.38787
                      - - -121.88251
                        - 37.38791
                      - - -121.88251
                        - 37.38791
                      - - -121.88259
                        - 37.38805
                      - - -121.88264
                        - 37.38816
                      - - -121.88284
                        - 37.38851
                      - - -121.8829
                        - 37.38863
                      - - -121.8829
                        - 37.38864
                      - - -121.883
                        - 37.38888
                      - - -121.88303
                        - 37.38896
                      - - -121.88312
                        - 37.38922
                      - - -121.88323
                        - 37.38956
                      - - -121.8834
                        - 37.39007
                      - - -121.88355
                        - 37.39052
                      - - -121.88358
                        - 37.39062
                      - - -121.88367
                        - 37.39078
                      - - -121.88382
                        - 37.39093
                      - - -121.88398
                        - 37.39104
                      - - -121.88424
                        - 37.39117
                      - - -121.88509
                        - 37.39158
                      - - -121.88509
                        - 37.39158
                      - - -121.88513
                        - 37.39153
                      - - -121.88531
                        - 37.3913
                      - - -121.8858
                        - 37.39067
                      - - -121.8858
                        - 37.39067
                      - - -121.88604
                        - 37.39095
                      - - -121.88604
                        - 37.39095
                  distance: 75766
                  duration: 3732
                  start_location:
                    type: Point
                    coordinates:
                      - -122.427528831
                      - 37.759384265
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8871193
                      - 37.390611
                visited_destination: false
                timeline: []
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Reassign Order
      description: Reassign an order to a worker. The order will be added in an
        optimal position if the worker already has an associated route
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReassignOrderRequest"
            example:
              worker_handle: Smith
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/plans/{plan_id}/trigger:
    post:
      parameters:
        - in: path
          name: plan_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlanOrdersResponse"
              example:
                message: Order Planning Initiated
                plan:
                  id: a7a92072e-bf31-44f5-8a59-c4fffb5f9d4
                  href: /orders/plans/a7a92072e-bf31-44f5-8a59-c4fffb5f9d4
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Trigger Planning for a Plan
      description: API to Trigger Planning for a plan
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/TriggerPlanningRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/{worker_handle}/locate:
    post:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/LocateResponse"
              examples:
                locate_pending_response_example:
                  summary: Locate accepted; request is pending while the SDK is woken and devices
                    are polled.
                  value:
                    request_id: 00000000-aaaa-bbbb-cccc-111122223333
                    worker_handle: worker001
                    status: pending
                    created_at: 2026-06-03T05:46:57.096Z
                    updated_at: 2026-06-03T05:46:57.096Z
                    devices:
                      - device_id: AAA11111-BBBB-2222-CCCC-3333DDDD4444
                        status: pending
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Locate a worker
      description: Initiates an async worker locate. The implementation sets the
        worker's availability=true (waking the SDK), pulls a fresh location from
        each currently-linked device, then sets availability back to false.
        Returns immediately with a request_id; poll the GET endpoint or listen
        for the `locate` webhook for the final result.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateLocateRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/{worker_handle}/history:
    get:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
        - in: query
          name: from_time
          description: ISO 8601 datetime indicating the start time
          schema:
            type: string
            format: date-time
            nullable: true
          required: false
        - in: query
          name: to_time
          description: ISO 8601 datetime indicating the end time
          schema:
            type: string
            format: date-time
            nullable: true
          required: false
        - in: query
          name: date
          description: Date in ISO 8601 format ('yyyy-MM-dd').
          schema:
            type: string
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetWorkerHistoryResponse"
              example:
                worker_handle: james@ht.com
                locations:
                  type: LineString
                  coordinates:
                    - - -118.460831
                      - 34.032051
                      - 13.2
                      - 2023-07-15T00:10:48.972Z
                    - - -118.460821
                      - 34.032056
                      - 13.2
                      - 2023-07-15T01:44:14.028Z
                    - - -118.460828
                      - 34.032056
                      - 13.2
                      - 2023-07-15T04:44:19.203Z
                markers:
                  - device_id: 00000000-4636-461C-B5F6-7E4BEFC09575
                    timestamp: 2023-04-24T19:19:59.569Z
                    type: device_linked
                  - type: device_status
                    data:
                      start:
                        recorded_at: 2023-07-15T00:00:00.000Z
                        location:
                          recorded_at: 2023-07-15T00:10:48.972Z
                          geometry:
                            type: Point
                            coordinates:
                              - -118.460831
                              - 34.032051
                      end:
                        recorded_at: 2023-07-16T17:51:30.068Z
                        location:
                          recorded_at: 2023-07-16T17:51:30.068Z
                          geometry:
                            type: Point
                            coordinates:
                              - -118.460847
                              - 34.032045
                      duration: 150690
                      value: active
                      address: 12511 Venice Blvd., Los Angeles, CA 90066
                      activity: stop
                      steps: 10
                      bubble:
                        centroid:
                          - -118.4372615
                          - 34.0033542
                        radius: 5
                    marker_id: c067c38c-e9a9-4fb2-b304-f8682ed3ad6b
                  - type: device_status
                    data:
                      start:
                        recorded_at: 2023-07-16T17:51:30.068Z
                        location:
                          recorded_at: 2023-07-16T17:51:30.068Z
                          geometry:
                            type: Point
                            coordinates:
                              - -118.460847
                              - 34.032045
                      end:
                        recorded_at: 2023-07-16T18:07:14.320Z
                        location:
                          recorded_at: 2023-07-16T18:07:14.320Z
                          geometry:
                            type: Point
                            coordinates:
                              - -118.517871
                              - 34.034686
                      duration: 944
                      value: active
                      activity: drive
                      distance: 8311
                    marker_id: 3329f37e-cc88-4631-ac7b-1652d1cf2eea
                  - type: device_status
                    data:
                      start:
                        recorded_at: 2023-07-16T18:07:14.320Z
                        location:
                          recorded_at: 2023-07-16T18:07:14.320Z
                          geometry:
                            type: Point
                            coordinates:
                              - -118.517871
                              - 34.034686
                      end:
                        recorded_at: 2023-07-16T18:17:17.487Z
                        location:
                          recorded_at: 2023-07-16T18:17:17.487Z
                          geometry:
                            type: Point
                            coordinates:
                              - -118.517892
                              - 34.034684
                      duration: 603
                      value: active
                      address: East Rustic Road, Pacific Palisades, LA, Los Angeles, California,
                        90402, United States of America
                      activity: stop
                      steps: 179
                      bubble:
                        centroid:
                          - -118.517875
                          - 34.034703
                        radius: 6
                    marker_id: fe82c586-295a-406a-8b5a-63e1b4e9bb44
                  - type: device_status
                    data:
                      start:
                        recorded_at: 2023-07-16T18:17:17.487Z
                        location:
                          recorded_at: 2023-07-16T18:17:17.487Z
                          geometry:
                            type: Point
                            coordinates:
                              - -118.517892
                              - 34.034684
                      end:
                        recorded_at: 2023-07-16T18:20:43.427Z
                        location:
                          recorded_at: 2023-07-16T18:20:43.427Z
                          geometry:
                            type: Point
                            coordinates:
                              - -118.516617
                              - 34.032466
                      duration: 206
                      value: active
                      activity: drive
                      distance: 837
                    marker_id: de4882aa-4a93-4614-a15f-844eb4987370
                started_at: 2023-07-15T00:00:00.000Z
                completed_at: 2023-07-17T00:00:00.000Z
                distance: 66410
                duration: 172799
                steps: 423
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Get Worker History
      description: Generate and fetch the worker history for the provided time range
      deprecated: true
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/{worker_handle}/undelete:
    post:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UndeleteWorkerResponse"
              example:
                worker_handle: james@ht.com
                ops_group_handle: store-sf
                product_types:
                  - plumbing
                  - hardware
                device_id: 00000000-4636-461C-B5F6-7E4BEFC09575
                profile:
                  workerId: "0012244"
                  vehicle: Ford F-150
                  zoneId: "4"
                status:
                  available: false
                  working: false
                schedule:
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: MONDAY
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: TUESDAY
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: WEDNESDAY
                created_at: 2023-06-01T02:00:00Z
                home:
                  address: 777 Story Rd, San Jose, CA 95122
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8624398
                      - 37.3304521
                  radius: 100
                device_status:
                  data:
                    activity: drive
                    recorded_at: 2023-10-03T20:42:44.969Z
                  value: active
                deleted: false
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
      tags:
        - Workers
      summary: Undelete Worker
      description: Undelete a previously deleted worker identified by the worker_handle
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/reschedule:
    post:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: type
          description: Type of the order which can be `drop` or `pick`
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: type_index
          description: Integer representing the `pick` or `drop` order index when having a
            pick/drop scenario
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: The attempt number for fulfilling the order
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RescheduleOrderResponse"
              example:
                order_handle: order-1
                fulfillment_attempt: 0
                status: unplanned
                destination:
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8871193
                      - 37.390611
                  address: 1709 Automation Pkwy, San Jose, CA 95101
                  radius: 100
                ops_group_handle: store-SF
                track_mode: on_time
                plan_mode: manual
                scheduled_after: 2023-10-31T02:00:00.000Z
                scheduled_at: 2023-10-31T04:00:00.000Z
                type: drop
                type_index: 0
                expected_service_time: 0
                capacity_used: 1
                metadata:
                  customerId: "1442"
                  name: Jordan
                region:
                  country: United States
                  city: San Jose
                  state: California
                product_type:
                  - frozen
                  - fragile
                created_at: 2023-10-30T22:22:54.071Z
                visited_destination: false
                timeline: []
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Reschedule Order
      description: Reschedule an order identified by the given order_handle. When an
        order has already been dispatched, this will automatically cancel and
        recreate a new order with the new scheduled timestamps in an `unplanned`
        state. When an order is in assigned/planned state, this will
        automatically remove it from the route and schedule is updated.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RescheduleOrderRequest"
            example:
              scheduled_after: 2023-10-31T02:00:00Z
              scheduled_at: 2023-10-31T04:00:00Z
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/routes/{route_handle}/add:
    post:
      parameters:
        - in: path
          name: route_handle
          schema:
            type: string
          required: true
        - in: query
          name: version
          description: Route version
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AddOrderToRouteResponse"
              example:
                route_handle: route-1
                ops_group_handle: SAN_JOSE_WH
                status: planned
                intent: on_time
                version: 1
                estimate:
                  start_by: 2023-03-14T23:20:00Z
                  distance: 1000
                  duration: 600
                  polyline:
                    type: LineString
                    coordinates:
                      - - 77.72123
                        - 12.89617
                      - - 77.72169
                        - 12.89595
                      - - 77.72214
                        - 12.89572
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8924515
                      - 37.4124516
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8984515
                      - 37.5124516
                orders:
                  - order_handle: order-101
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    worker_handle: James
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-14T23:50:00Z
                    scheduled_after: 2023-03-14T23:20:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: Fremont
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8984515
                          - 37.5124516
                      radius: 50
                      address: Mission Peak, Fremont CA 94539
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                  - order_handle: order-100
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-15T01:30:00Z
                    scheduled_after: 2023-03-15T01:00:00Z
                    metadata:
                      customerId: "1224244"
                    region:
                      city: San Francisco
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -122.3779263
                          - 37.7320465
                      radius: 50
                      address: 888 Innes Ave, San Francisco, CA 94124
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                  - order_handle: order-102
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    intent: on_time
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-15T02:30:00Z
                    scheduled_after: 2023-03-14T03:00:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: San Francisco
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -122.3848312
                          - 37.7323863
                      radius: 50
                      address: 1195 Hudson Ave, San Francisco, CA 94124
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                metadata:
                  planId: "1223322"
                embed_url: https://embed.hypertrack.com/dkdkddnd
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Add Order
      description: Add orders to a route
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/AddOrderToRouteRequest"
            example:
              orders:
                - order_handles: order-101
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/{worker_handle}/approvers:
    get:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
        - in: query
          name: limit
          description: Maximum number of approvers to return
          schema:
            type: integer
            default: 100
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Token for pagination to get next page of results
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: approver_type
          description: Filter by approver type
          schema:
            enum:
              - worker
              - dashboard_user
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WorkerApproverListResponse"
              example:
                approvers:
                  - worker_handle: worker_456
                    approver_id: user_123
                    approver_type: worker
                    created_at: 2025-01-15T10:30:00Z
                    updated_at: null
                  - worker_handle: worker_456
                    approver_id: manager_789
                    approver_type: dashboard_user
                    created_at: 2025-01-15T09:15:00Z
                    updated_at: null
                total_count: 2
                limit: 100
                pagination_token: eyJsYXN0X2NyZWF0ZWRfYXQiOiIyMDI1LTAxLTE1VDA5OjE1OjAwWiIsImxhc3RfYXBwcm92ZXJfaWQiOiJtYW5hZ2VyXzc4OSJ9
          description: List of worker approvers retrieved successfully
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                worker_not_found:
                  summary: driver_not_found
                  value:
                    code: driver_not_found
                    title: Worker Not Found
                    detail:
                      description: Worker not found for handle worker_456
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: List Worker Approvers
      description: Get a list of all approvers for a specific worker with optional
        filtering and token-based pagination.
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
      responses:
        "201":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/WorkerApproverResponse"
              example:
                worker_handle: worker_456
                approver_id: user_123
                approver_type: worker
                created_at: 2025-01-15T10:30:00Z
                updated_at: null
          description: Worker approver created successfully
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                invalid_approver_type:
                  summary: validation_error
                  value:
                    code: validation_error
                    title: Validation Error
                    detail: "Invalid approver_type: invalid_type. Must be one of ['worker',
                      'dashboard_user']"
                approver_already_exists:
                  summary: approver_already_exists
                  value:
                    code: approver_already_exists
                    title: Validation Error
                    detail: Approver user_123 already exists for worker worker_456
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                worker_not_found:
                  summary: driver_not_found
                  value:
                    code: driver_not_found
                    title: Worker Not Found
                    detail:
                      description: Worker not found for handle worker_456
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Create Worker Approver
      description: Create a new approver for a worker. The approver can be either a
        worker or a dashboard user.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateWorkerApproverRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/{worker_handle}/work_status:
    post:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SetWorkerStatusResponse"
              example:
                worker_handle: james@ht.com
                ops_group_handle: store-sf
                product_types:
                  - plumbing
                  - hardware
                device_id: 00000000-4636-461C-B5F6-7E4BEFC09575
                profile:
                  workerId: "0012244"
                  vehicle: Ford F-150
                  zoneId: "4"
                status:
                  available: true
                  working: false
                schedule:
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: MONDAY
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: TUESDAY
                  - start_time: 02:00
                    end_time: 18:00
                    day_of_week: WEDNESDAY
                created_at: 2023-06-01T02:00:00Z
                home:
                  address: 777 Story Rd, San Jose, CA 95122
                  geometry:
                    type: Point
                    coordinates:
                      - -121.8624398
                      - 37.3304521
                  radius: 100
                device_status:
                  data:
                    activity: drive
                    recorded_at: 2023-10-03T20:42:44.969Z
                  value: active
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Set Worker Work Status
      description: Set the work status of a worker identified by the worker_handle
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SetWorkerStatusRequest"
            example:
              available: true
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/routes/{route_handle}/remove:
    post:
      parameters:
        - in: path
          name: route_handle
          schema:
            type: string
          required: true
        - in: query
          name: version
          description: Route version
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RemoveOrderFromRouteResponse"
              example:
                route_handle: route-1
                ops_group_handle: SAN_JOSE_WH
                status: planned
                intent: on_time
                version: 1
                estimate:
                  start_by: 2023-03-14T23:20:00Z
                  distance: 800
                  duration: 500
                  polyline:
                    type: LineString
                    coordinates:
                      - - 77.72123
                        - 12.89617
                      - - 77.72169
                        - 12.89595
                      - - 77.72214
                        - 12.89572
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8924515
                      - 37.4124516
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8984515
                      - 37.5124516
                orders:
                  - order_handle: order-100
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-15T01:30:00Z
                    scheduled_after: 2023-03-15T01:00:00Z
                    metadata:
                      customerId: "1224244"
                    region:
                      city: San Francisco
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -122.3779263
                          - 37.7320465
                      radius: 50
                      address: 888 Innes Ave, San Francisco, CA 94124
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                  - order_handle: order-102
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    intent: on_time
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-15T02:30:00Z
                    scheduled_after: 2023-03-14T03:00:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: San Francisco
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -122.3848312
                          - 37.7323863
                      radius: 50
                      address: 1195 Hudson Ave, San Francisco, CA 94124
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                metadata:
                  planId: "1223322"
                embed_url: https://embed.hypertrack.com/dkdkddnd
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Remove Order
      description: Remove orders from a route, response can be empty if all orders are
        removed
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RemoveOrderFromRouteRequest"
            example:
              orders:
                - order_handles: order-101
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/ops-groups/{ops_group_handle}:
    get:
      parameters:
        - in: path
          name: ops_group_handle
          schema:
            type: string
          required: true
        - in: query
          name: include_schedule
          description: Flag to include ops group's schedule in the response.
          schema:
            type: boolean
            default: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetOpsGroupResponse"
              example:
                ops_group_handle: san-jose-store
                ops_group_label: store
                timezone: America/Los_Angeles
                route_start_location: ops_group_home
                route_completion_type: manual
                ops_group_home:
                  geometry:
                    type: Point
                    coordinates:
                      - -121.94186
                      - 37.3570534
                  address: 1709 Automation Pkwy, San Jose, CA 95101
                objective_fn: minimise_time
                route_capacity: 10
                route_max_distance: 20000
                default_shift_start_time: 07:00
                default_shift_end_time: 19:00
                order_tracking_mode: manual
                shift_availability_mode: manual
                order_tracking_automation:
                  type: manual
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Get Ops Group by Handle
      description: Fetch ops group by ops_group_handle
      security:
        - BasicAuth: []
        - TokenAuth: []
    patch:
      parameters:
        - in: path
          name: ops_group_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PatchOpsGroupResponse"
              example:
                ops_group_handle: san-jose-store
                ops_group_label: store
                timezone: America/Los_Angeles
                route_start_location: ops_group_home
                route_completion_type: manual
                ops_group_home:
                  geometry:
                    type: Point
                    coordinates:
                      - -121.93186
                      - 36.3570534
                  address: 1709 Automation Pkwy, San Jose, CA 95101
                objective_fn: minimise_time
                route_capacity: 10
                route_max_distance: 20000
                default_shift_start_time: 07:00
                default_shift_end_time: 19:00
                order_tracking_mode: manual
                shift_availability_mode: manual
                order_tracking_automation:
                  type: manual
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Workers
      summary: Update Ops Group
      description: Update Ops Group by ops_group_handle
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchOpsGroupRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/routes/{route_handle}/complete:
    post:
      parameters:
        - in: path
          name: route_handle
          schema:
            type: string
          required: true
        - in: query
          name: version
          description: Route version
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CompleteRouteResponse"
              example:
                route_handle: route-1
                ops_group_handle: SAN_JOSE_WH
                plan_mode: manual
                status: completed
                completed_at: 2023-03-14T23:55:00Z
                worker_handle: James
                version: 1
                estimate:
                  start_by: 2023-03-14T23:20:00Z
                  distance: 1000
                  duration: 600
                  polyline:
                    type: LineString
                    coordinates:
                      - - 77.72123
                        - 12.89617
                      - - 77.72169
                        - 12.89595
                      - - 77.72214
                        - 12.89572
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8924515
                      - 37.4124516
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8984515
                      - 37.5124516
                orders:
                  - order_handle: order-101
                    fulfillment_attempt: 1
                    status: completed
                    completed_at: 2023-03-14T23:55:00Z
                    ops_group_handle: store-sjc
                    worker_handle: James
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-14T23:50:00Z
                    scheduled_after: 2023-03-14T23:20:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: Fremont
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8984515
                          - 37.5124516
                      radius: 50
                      address: Mission Peak, Fremont CA 94539
                    risk_status: false
                    expected_service_time: 600
                    actual_service_time: 0
                    tracked_service_time: 0
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                metadata:
                  customerId: "4255534"
                  zone: 4
                embed_url: https://embed.hypertrack.com/dkdkddnd
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                route_already_completed:
                  summary: validation_error
                  value:
                    code: validation_error
                    title: Route already completed
                    detail: Route with the given ID is already completed
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Complete Route
      description: API to Mark the route as completed, this will cancel the non
        terminal orders implicitly
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CompleteRouteRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/routes/{route_handle}/reassign:
    post:
      parameters:
        - in: path
          name: route_handle
          schema:
            type: string
          required: true
        - in: query
          name: version
          description: Route version
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ReassignRouteResponse"
              example:
                route_handle: route-1
                ops_group_handle: SAN_JOSE_WH
                plan_mode: manual
                status: assigned
                worker_handle: James
                version: 1
                estimate:
                  start_by: 2023-03-14T23:20:00Z
                  distance: 1000
                  duration: 600
                  polyline:
                    type: LineString
                    coordinates:
                      - - 77.72123
                        - 12.89617
                      - - 77.72169
                        - 12.89595
                      - - 77.72214
                        - 12.89572
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8924515
                      - 37.4124516
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8984515
                      - 37.5124516
                orders:
                  - order_handle: order-101
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    worker_handle: James
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-14T23:50:00Z
                    scheduled_after: 2023-03-14T23:20:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: Fremont
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8984515
                          - 37.5124516
                      radius: 50
                      address: Mission Peak, Fremont CA 94539
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                metadata:
                  customerId: "4255534"
                  zone: 4
                embed_url: https://embed.hypertrack.com/dkdkddnd
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Reassign Route
      description: Reassign the route to a different worker. Please provide either a
        worker_handle or the device_id of the new worker to whom the route needs
        to be assigned.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ReassignRouteRequest"
            example:
              worker_handle: James
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/routes/{route_handle}/optimise:
    post:
      parameters:
        - in: path
          name: route_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OptimiseRouteResponse"
              example:
                route_handle: route-1
                ops_group_handle: SAN_JOSE_WH
                plan_mode: manual
                status: completed
                completed_at: 2023-03-14T23:55:00Z
                worker_handle: James
                version: 1
                estimate:
                  start_by: 2023-03-14T23:20:00Z
                  distance: 1000
                  duration: 600
                  polyline:
                    type: LineString
                    coordinates:
                      - - 77.72123
                        - 12.89617
                      - - 77.72169
                        - 12.89595
                      - - 77.72214
                        - 12.89572
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8924515
                      - 37.4124516
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8984515
                      - 37.5124516
                orders:
                  - order_handle: order-101
                    fulfillment_attempt: 1
                    status: completed
                    completed_at: 2023-03-14T23:55:00Z
                    ops_group_handle: store-sjc
                    worker_handle: James
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-14T23:50:00Z
                    scheduled_after: 2023-03-14T23:20:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: Fremont
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8984515
                          - 37.5124516
                      radius: 50
                      address: Mission Peak, Fremont CA 94539
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                metadata:
                  customerId: "4255534"
                  zone: 4
                embed_url: https://embed.hypertrack.com/dkdkddnd
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Optimise Orders Sequence
      description: This API is used to optimise the orders sequence in a Route
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/OptimiseRouteRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/tasks/{task_id}:
    patch:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: path
          name: task_id
          schema:
            type: string
          required: true
        - in: query
          name: fulfillment_attempt
          description: The attempt number for order fulfillment.
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/OrderTaskResponse"
              example:
                task_id: b7e6f8c2-1d2a-4e3b-9c3d-2e5a6b7c8d9e
                label: order_summary
                description: Generate order summary for order 001
                priority: high
                status: in_progress
                created_at: 2023-10-01T12:00:00Z
                updated_at: 2023-10-01T12:00:00Z
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                order_not_found:
                  summary: order_not_found
                  value:
                    code: order_not_found
                    title: Order Not Found
                    detail:
                      description: Order not found for handle <order_handle>
                order_task_not_found:
                  summary: order_task_not_found
                  value:
                    code: order_task_not_found
                    title: Order Task Not Found
                    detail:
                      description: Order Task not found for id <task_id> in order <order_handle>
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Update Order Task
      description: Updates the details of a specific task associated with an order.
        This endpoint is used to modify the status and details of a task by its
        ID.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateOrderTaskRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
    delete:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: path
          name: task_id
          schema:
            type: string
          required: true
        - in: query
          name: fulfillment_attempt
          description: The attempt number for order fulfillment.
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                order_not_found:
                  summary: order_not_found
                  value:
                    code: order_not_found
                    title: Order Not Found
                    detail:
                      description: Order not found for handle <order_handle>
                order_task_not_found:
                  summary: order_task_not_found
                  value:
                    code: order_task_not_found
                    title: Order Task Not Found
                    detail:
                      description: Order Task not found for id <task_id> in order <order_handle>
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Delete Order Task
      description: Deletes a specific task associated with an order. This endpoint is
        used to remove tasks that are no longer needed.
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/{order_handle}/candidate_workers:
    get:
      parameters:
        - in: path
          name: order_handle
          schema:
            type: string
          required: true
        - in: query
          name: type
          description: Type of the order which can be `drop` or `pick`
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: type_index
          description: Integer representing the `pick` or `drop` order index when having a
            pick/drop scenario
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: fulfillment_attempt
          description: The attempt number for fulfilling the order
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: profile_filter
          description: Profile filter to be applied on the list of workers before
            returning the candidates
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Number of candidate workers to return
          schema:
            type: integer
            default: 10
            nullable: true
          required: false
        - in: query
          name: skip_already_assigned_worker
          description: If true, only return workers which are different than already
            assigned to the order.
          schema:
            type: boolean
            default: false
            nullable: true
          required: false
        - in: query
          name: allow_ongoing_order
          description: If true, skip the guard that rejects requests for orders in ongoing
            state.
          schema:
            type: boolean
            default: false
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CandidateWorkersResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Get Candidate Workers
      description: Get candidate workers for an order identified by the given order_handle
      security:
        - BearerAuth: []
  /orders/routes/{route_handle}/resequence:
    post:
      parameters:
        - in: path
          name: route_handle
          schema:
            type: string
          required: true
        - in: query
          name: version
          description: Route version
          schema:
            type: integer
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ResequenceOrdersInRouteResponse"
              example:
                route_handle: route-1
                ops_group_handle: SAN_JOSE_WH
                status: planned
                intent: on_time
                version: 1
                estimate:
                  start_by: 2023-03-14T23:20:00Z
                  distance: 1000
                  duration: 600
                  polyline:
                    type: LineString
                    coordinates:
                      - - 77.72123
                        - 12.89617
                      - - 77.72169
                        - 12.89595
                      - - 77.72214
                        - 12.89572
                  start_location:
                    type: Point
                    coordinates:
                      - -121.8924515
                      - 37.4124516
                  end_location:
                    type: Point
                    coordinates:
                      - -121.8984515
                      - 37.5124516
                orders:
                  - order_handle: order-101
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    worker_handle: James
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-14T23:50:00Z
                    scheduled_after: 2023-03-14T23:20:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: Fremont
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -121.8984515
                          - 37.5124516
                      radius: 50
                      address: Mission Peak, Fremont CA 94539
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                  - order_handle: order-100
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-15T01:30:00Z
                    scheduled_after: 2023-03-15T01:00:00Z
                    metadata:
                      customerId: "1224244"
                    region:
                      city: San Francisco
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -122.3779263
                          - 37.7320465
                      radius: 50
                      address: 888 Innes Ave, San Francisco, CA 94124
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                  - order_handle: order-102
                    fulfillment_attempt: 1
                    status: assigned
                    ops_group_handle: store-sjc
                    device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                    intent: on_time
                    created_at: 2023-03-14T23:00:00Z
                    scheduled_at: 2023-03-15T02:30:00Z
                    scheduled_after: 2023-03-14T03:00:00Z
                    metadata:
                      customerId: "1223344"
                    region:
                      city: San Francisco
                      state: California
                      country: United States of America
                    destination:
                      geometry:
                        type: Point
                        coordinates:
                          - -122.3848312
                          - 37.7323863
                      radius: 50
                      address: 1195 Hudson Ave, San Francisco, CA 94124
                    risk_status: false
                    expected_service_time: 600
                    product_type:
                      - plumber
                    type: drop
                    capacity_used: 5
                device_id: 2F659D4D-B524-45F0-A6E2-093CF2BB5574
                metadata:
                  planId: "1223322"
                embed_url: https://embed.hypertrack.com/dkdkddnd
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Resequence Orders
      description: Change the sequence of a set of orders in a route
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/ResequenceOrdersInRouteRequest"
            example:
              orders:
                - order_handles: order-101
                - order_handles: order-100
                - order_handles: order-102
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/estimated-routes/{estimated_route_id}:
    get:
      parameters:
        - in: path
          name: estimated_route_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetEstimatedRouteResponse"
              example:
                estimated_route_id: abc123def456
                polyline:
                  type: LineString
                  coordinates:
                    - - -122.39809
                      - 37.793038
                    - - -122.397
                      - 37.794
                    - - -122.395
                      - 37.795
                start_location:
                  type: Point
                  coordinates:
                    - -122.39809
                    - 37.793038
                end_location:
                  type: Point
                  coordinates:
                    - -122.395
                    - 37.795
                distance: 15000
                duration: 1800
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
      tags:
        - Orders
      summary: Get estimated route polyline
      description: "

        \    Retrieve the route polyline for an estimated route by its ID.


        \    The `estimated_route_id` is provided in `eta_change` and
        `eta_change_v2` webhooks.

        \    Use this endpoint to fetch the route polyline that was used for the
        ETA calculation.


        \    The response includes:

        \    - The route polyline as a GeoJSON LineString

        \    - Start and end locations

        \    - Total distance (meters) and duration (seconds) of the route

        \    "
      security:
        - BasicAuth: []
        - TokenAuth: []
  /visits/{visit_id}/attachments/{attachment_id}:
    delete:
      parameters:
        - in: path
          name: visit_id
          schema:
            type: string
          required: true
        - in: path
          name: attachment_id
          schema:
            type: string
          required: true
      responses:
        "204":
          description: Attachment deleted successfully
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Visits
      summary: Delete Attachment
      description: Delete an attachment associated with a specific visit by ID.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DeleteAttachmentRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /orders/tasks-definitions/{task_definition_id}:
    get:
      parameters:
        - in: path
          name: task_definition_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TasksDefinitionResponse"
              example:
                task_definition_id: c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f
                label: order_tasks_definition 1
                tasks:
                  - label: order_summary
                    description: Generate order summary for order 001
                    priority: high
                  - label: order_billing_summary
                    description: Generate billing summary for order 001
                    priority: medium
                created_at: 2023-10-01T12:00:00Z
                updated_at: 2023-10-01T12:00:00Z
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
      tags:
        - Orders
      summary: Get Tasks Definition
      description: Retrieves the details of a specific task definition for an order.
        This endpoint is used to view the structure and requirements of tasks
        that can be created for orders.
      security:
        - BasicAuth: []
        - TokenAuth: []
    patch:
      parameters:
        - in: path
          name: task_definition_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/TasksDefinitionResponse"
              example:
                task_definition_id: c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f
                label: order_tasks_definition 1 updated
                tasks:
                  - label: order_summary
                    description: Generate order summary for order 001
                    priority: high
                  - label: order_billing_summary
                    description: Generate billing summary for order 001
                    priority: medium
                created_at: 2023-10-01T12:00:00Z
                updated_at: 2023-10-01T12:00:00Z
          description: Successful response
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                ops_group_not_defined:
                  summary: ops_group_not_defined
                  value:
                    code: ops_group_not_defined
                    title: Ops Group is not defined
                    detail:
                      description: Ops Group <ops_group_handle> does not exist
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Orders
      summary: Update Tasks Definition
      description: Updates an existing task definition for an order. This endpoint is
        used to modify the structure and requirements of tasks that can be
        created for orders.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/UpdateTasksDefinitionRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
    delete:
      parameters:
        - in: path
          name: task_definition_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema: {}
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
      tags:
        - Orders
      summary: Delete Tasks Definition
      description: Deletes a specific task definition for an order. This endpoint is
        used to remove task definitions that are no longer needed.
      security:
        - BasicAuth: []
        - TokenAuth: []
  /workers/{worker_handle}/approvers/{approver_id}:
    delete:
      parameters:
        - in: path
          name: worker_handle
          schema:
            type: string
          required: true
        - in: path
          name: approver_id
          schema:
            type: string
          required: true
      responses:
        "204":
          description: Worker approver deleted successfully
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
              examples:
                worker_not_found:
                  summary: driver_not_found
                  value:
                    code: driver_not_found
                    title: Worker Not Found
                    detail:
                      description: Worker not found for handle worker_456
                approver_not_found:
                  summary: worker_approver_not_found
                  value:
                    code: worker_approver_not_found
                    title: Worker Approver Not Found
                    detail:
                      description: "Worker approver not found for worker_handle: worker_456,
                        approver_id: user_123"
      tags:
        - Workers
      summary: Delete Worker Approver
      description: Remove a specific approver from a worker.
      security:
        - BasicAuth: []
        - TokenAuth: []
  /places/v1/:
    get:
      parameters:
        - in: query
          name: place_handles
          description: List of place handles as comma separated strings used for fetching
            associated Places
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: search_term
          description: Keyword to match against place handle (or place id) OR name OR
            metadata
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: name
          description: Filter places by name (case-insensitive partial match)
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: lat
          description: latitude of location around which places should be searched
          schema:
            type: number
            nullable: true
          required: false
        - in: query
          name: lon
          description: longitude of location around which places should be searched
          schema:
            type: number
            nullable: true
          required: false
        - in: query
          name: radius
          description: radius around location which places should be searched, if given
            metadata is ignored
          schema:
            type: integer
            nullable: true
          required: false
        - in: query
          name: metadata
          description: metadata of the order as json encoded string
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: min_skew
          description: Minimum skew to filter for. Skew in inferred geofence can be
            between 0 and 1. 0 mean no skew, i.e. perfect overlap and 1 means no
            overlap
          schema:
            type: number
            nullable: true
          required: false
        - in: query
          name: sort_by
          description: Key on which result must be sorted.
          schema:
            type: string
            enum:
              - order_count
              - skew
              - last_updated
            nullable: true
          required: false
        - in: query
          name: sort_direction
          description: Sort route responses by `asc` or `desc` on the created_at timestamp
          schema:
            type: string
            enum:
              - asc
              - desc
            nullable: true
          required: false
        - in: query
          name: geofence_type
          description: Filter to fetch the specified geofence type.
          schema:
            type: string
            enum:
              - Point
              - Polygon
            nullable: true
          required: false
        - in: query
          name: has_suggested_places
          description: Filter to fetch the places which has suggested geofences
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: suggestion_type
          description: "Filter to fetch places by suggestion type. Comma-separated list
            of: 'manual', 'inferred', 'bounding_box'"
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: aggregate
          description: Whether to return aggregates, i.e. count of places
          schema:
            type: boolean
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Identifier used to fetch the next page of data
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Maximum number of results to be returned.
          schema:
            type: integer
            nullable: true
            minimum: 0
            maximum: 100
          required: false
        - in: query
          name: from_date
          description: Start date (YYYY-MM-DD) of the time window used as a filter to
            retrieve places visited on a specific date, regardless of the
            timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: to_date
          description: End date (YYYY-MM-DD) of the time window used as a filter to
            retrieve places visited on a specific date, regardless of the
            timezone.
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: visit_detection_config
          description: Worker detection config as json encoded string
          schema:
            type: string
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlacesResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Places
      summary: Get places
      description: Get places with filters. Response includes the 'name' field for
        each place if available.
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters: []
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlaceResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Places
      summary: Create a new Place in system
      description: Create a new place in hypertrack. The 'name' parameter allows you
        to provide a human-readable name for the place.
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PlaceCreateRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /places/v1/segments:
    get:
      parameters:
        - in: query
          name: segment
          description: Represents the segment used to retrieve the corresponding values
          schema:
            type: string
          required: true
        - in: query
          name: prefix
          description: Represents the prefix to be used when filtering segment values
          schema:
            type: string
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GetPlaceSegmentsResponse"
              example:
                segments:
                  - data:name
                  - data:description
                  - data:category
                truncated: false
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Places
      summary: Get Place Segments
      description: Fetch segments from the place metadata that are associated with all
        metadata
      security:
        - BasicAuth: []
        - TokenAuth: []
  /places/v1/{place_handle}:
    get:
      parameters:
        - in: path
          name: place_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlaceResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
      tags:
        - Places
      summary: Get place by id
      description: Get place by id/handle. Response includes the 'name' field if available.
      security:
        - BasicAuth: []
        - TokenAuth: []
    patch:
      parameters:
        - in: path
          name: place_handle
          schema:
            type: string
          required: true
        - in: query
          name: update_associated_orders
          description: If true, updates all non-terminal orders associated with this
            place_handle to reflect the updated place destination.
          schema:
            type: boolean
            default: false
            nullable: true
          required: false
        - in: query
          name: update_geometry_using_address
          description: If true, geocodes the place using the address provided in the
            request body and updates the geometry with the geocoded coordinates.
          schema:
            type: boolean
            default: false
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlaceResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Places
      summary: Updates a place
      description: "Updates a place, send empty array to remove values for an array
        type parameter, null values will be ignored. eg. {\"parkings\": []} to
        clear parkings of a places instead of  {\"parkings\": null}. The 'name'
        parameter can be updated to change the human-readable name of the
        place."
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PlacePatchRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
    delete:
      parameters:
        - in: path
          name: place_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema: {}
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
      tags:
        - Places
      summary: Delete a place
      description: Delete a place
      security:
        - BasicAuth: []
        - TokenAuth: []
  /places/v1/{place_handle}/history:
    get:
      parameters:
        - in: path
          name: place_handle
          schema:
            type: string
          required: true
        - in: query
          name: pagination_token
          description: Identifier used to fetch the next page of data
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Maximum number of results to return
          schema:
            type: integer
            default: 20
            nullable: true
            minimum: 1
            maximum: 100
          required: false
        - in: query
          name: field_name
          description: "Filter to show only changes related to a specific field. Allowed
            values: place_handle, name, geofence, metadata, parkings, checkins,
            timings, closed_on, expected_service_time, locked_from_suggestions"
          schema:
            type: string
            enum:
              - place_handle
              - name
              - geofence
              - metadata
              - parkings
              - checkins
              - timings
              - closed_on
              - expected_service_time
              - locked_from_suggestions
            nullable: true
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlaceHistoryResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Places
      summary: Get place audit history
      description: Retrieve audit history for a place showing all changes over time
        with pagination. Use the field_name parameter to filter history to only
        show changes for a specific field.
      security:
        - BasicAuth: []
        - TokenAuth: []
  /places/v1/{place_handle}/suggestions/:
    get:
      parameters:
        - in: path
          name: place_handle
          schema:
            type: string
          required: true
        - in: query
          name: suggested_on_from
          description: Start timestamp (ISO 8601 format) to filter suggestions created on
            or after this time
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: suggested_on_to
          description: End timestamp (ISO 8601 format) to filter suggestions created on or
            before this time
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: pagination_token
          description: Identifier used to fetch the next page of suggestions
          schema:
            type: string
            nullable: true
          required: false
        - in: query
          name: limit
          description: Maximum number of results to be returned.
          schema:
            type: integer
            nullable: true
            minimum: 0
            maximum: 100
          required: false
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SuggestionListResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Places
      summary: Get suggestions for a place
      description: Get suggestions for a place
      security:
        - BasicAuth: []
        - TokenAuth: []
    post:
      parameters:
        - in: path
          name: place_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SuggestionResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Places
      summary: Create a suggestion for a place
      description: Create a suggestion for a place
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SuggestionCreateRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
  /places/v1/{place_handle}/inferences/clear:
    post:
      parameters:
        - in: path
          name: place_handle
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlaceResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
      tags:
        - Places
      summary: Clear the inferences of a place
      description: Clears the inferences of a place, i.e. inferred geofences, parking,
        checking locations etc
      security:
        - BasicAuth: []
        - TokenAuth: []
  /places/v1/{place_handle}/suggestions/{suggestion_id}/apply:
    post:
      parameters:
        - in: path
          name: place_handle
          schema:
            type: string
          required: true
        - in: path
          name: suggestion_id
          schema:
            type: string
          required: true
      responses:
        "200":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SuggestionResponse"
          description: Successful response
        "401":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Authentication error
        "404":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/HTTPError"
          description: Not found
        "422":
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ValidationError"
          description: Validation error
      tags:
        - Places
      summary: Apply a suggestion to a place
      description: Apply a suggestion to a place
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/SuggestionApplyRequest"
      security:
        - BasicAuth: []
        - TokenAuth: []
components:
  schemas:
    ValidationError:
      properties:
        detail:
          type: object
          properties:
            <location>:
              type: object
              properties:
                <field_name>:
                  type: array
                  items:
                    type: string
        message:
          type: string
      type: object
    HTTPError:
      properties:
        detail:
          type: object
        message:
          type: string
      type: object
    PointGeometry:
      type: object
      properties:
        coordinates:
          type: array
          description: Location coordinates represented as [longitude, latitude]
          items:
            type: number
        type:
          type: string
          default: Point
          enum:
            - Point
          description: Geometry type
      required:
        - coordinates
    PolygonGeometry:
      type: object
      properties:
        type:
          type: string
          enum:
            - Polygon
          description: Geometry type
        coordinates:
          type: array
          description: Location coordinates represented as [[[longitude, latitude], [lon,
            lat]...]]
          items:
            type: array
            items:
              type: array
              items:
                type: number
      required:
        - coordinates
        - type
    OrderDestinationSpecialType:
      type: object
      properties:
        geofence_id:
          type: string
          nullable: true
          description: Geofence ID to extract geometry from
        place_handle:
          type: string
          nullable: true
          description: Place Handle to extract geometry from
        address:
          type: string
          nullable: true
          description: Address for the order destination
        geometry:
          description: GeoJSON representation of point geometry for the order destination
          oneOf:
            - $ref: "#/components/schemas/PointGeometry"
            - $ref: "#/components/schemas/PolygonGeometry"
        place_id:
          type: string
          nullable: true
          description: Place ID
        radius:
          type: integer
          default: 30
          nullable: true
          description: Radius of the circular geofence representing the order destination
      required:
        - geometry
    Region:
      type: object
      properties:
        country:
          type: string
          description: Country
        city:
          type: string
          nullable: true
          description: City
        state:
          type: string
          nullable: true
          description: State
      required:
        - country
    LocationGeometryResponse:
      type: object
      properties:
        type:
          type: string
          description: Geometry type
        coordinates:
          type: array
          description: Location coordinates represented as list of [longitude, latitude].
          items:
            nullable: true
      required:
        - coordinates
        - type
    DriverLocation:
      type: object
      properties:
        geometry:
          description: Current location of the driver, a geojson of type Point
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        bearing:
          type: number
          description: Bearing of the driver
        accuracy:
          type: number
          description: Accuracy of location the driver
        speed:
          type: number
          description: Speed of the driver
        recorded_at:
          type: string
          description: Time when the location of the driver was recorded
      required:
        - accuracy
        - bearing
        - geometry
        - recorded_at
        - speed
    OrderListEstimate:
      type: object
      properties:
        start_at:
          type: string
          nullable: true
          description: Estimated timestamp by which a driver should start travelling to
            fulfill all the orders on time
        start_by:
          type: string
          nullable: true
          description: Estimated timestamp by which a driver should start travelling to
            fulfill all the orders on time
        arrive_at:
          type: string
          nullable: true
          description: Estimated timestamp by which a driver should arrive at order
            destination
        distance:
          type: integer
          nullable: true
          description: Estimated total distance that the driver should travel
        duration:
          type: integer
          nullable: true
          description: Estimated total time that the driver should spend to fulfill all
            orders in the route
        initial_arrive_at:
          type: string
          nullable: true
          description: Initial Estimated timestamp by which a driver should arrive at the
            destination
        current_worker_location:
          nullable: true
          description: Current Worker location details
          allOf:
            - $ref: "#/components/schemas/DriverLocation"
    Source:
      type: object
      properties:
        source:
          type: string
          nullable: true
          description: Source of the request
        timestamp:
          type: string
          nullable: true
          description: Time when request was made
        ip-address:
          type: string
          nullable: true
          description: IP address of source
        device_id:
          type: string
          nullable: true
          description: Id of the device that made the request
        driver_handle:
          type: string
          nullable: true
          description: Id of the driver who made the request
        user_id:
          type: string
          nullable: true
          description: Id of the user who made the request
        email:
          type: string
          nullable: true
          description: Email of the user who made the request
    OrderOutageSummary:
      type: object
      properties:
        duration:
          type: integer
          description: Sum total duration of all outages experienced with this `code` in
            the specified time range.
        distance:
          type: integer
          description: Sum total (estimated) distance covered during all outages
            experienced with this `code` in the specified time range.
        code:
          type: string
          description: Code indicating the type of outage
        label:
          type: string
          description: Text indicating the type of outage
        description:
          type: string
          description: Text describing the outage.
        category:
          type: string
          enum:
            - behavioural
            - adversarial
            - reachability
            - os
            - sporadic
          nullable: true
          description: String indicating the category of outage
      required:
        - code
        - description
        - duration
        - label
    OrderTask:
      type: object
      properties:
        label:
          type: string
          description: Type of task to be created for the order.
        task_definition_id:
          type: string
          nullable: true
          description: Id of the tasks definition from which this task is picked
        description:
          type: string
          nullable: true
          description: Description of the task type.
        metadata:
          type: object
          nullable: true
          description: Additional metadata for the task.
          additionalProperties:
            nullable: true
        priority:
          type: string
          enum:
            - none
            - low
            - medium
            - high
          nullable: true
          description: Priority of the task. Valid values are none, low, medium, high.
        task_id:
          type: string
          description: Unique identifier for the created task.
        status:
          type: string
          nullable: true
          description: Status of the task. Valid values are pending, ongoing, completed,
            cancelled.
      required:
        - label
        - task_id
    OrderResponse:
      type: object
      properties:
        timezone:
          type: string
          nullable: true
          description: Time zone
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          enum:
            - planned
            - assigned
            - dispatched
            - ongoing
            - disabled
            - cancelled
            - completed
            - summarizing
            - unplanned
          description: Current state of the order - `unplanned`, `planned`, `assigned`,
            `ongoing`, `completed`, `cancelled`
        destination:
          description: Destination for the order
          allOf:
            - $ref: "#/components/schemas/OrderDestinationSpecialType"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the orders in the
            route are associated
        plan_mode:
          enum:
            - on_demand
            - scheduled
            - pool
            - manual
          nullable: true
          description: Value indicating how the order was planned - `on_demand`, `manual`,
            `scheduled`
        plan_id:
          type: string
          nullable: true
          description: Order plans identifier
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        driver_name:
          type: string
          nullable: true
          description: Customer provided name for the driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            nullable: true
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify the index of type
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderListEstimate"
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        track_mode:
          enum:
            - on_time
            - flex
            - on_shift
            - pre_shift
            - full_shift
          nullable: true
          description: Value representing whether the order is tracked in on_shift,
            pre_shift or full_shift mode. Modes such as `on_time` and `flex` are
            deprecated.
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver was tracked at the location when
            fulfilling the order
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after order start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after order
            start
        created_by:
          nullable: true
          description: Source of the order creation. This can be a user, system, or any
            other entity responsible for creating the order.
          allOf:
            - $ref: "#/components/schemas/Source"
        outage_summary:
          type: array
          nullable: true
          description: List of outages experienced during the specified time range.
          items:
            $ref: "#/components/schemas/OrderOutageSummary"
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Order is expected to switch device
        tasks:
          type: array
          nullable: true
          description: List of tasks associated with the order.
          items:
            $ref: "#/components/schemas/OrderTask"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order.
        worker_profile:
          type: object
          nullable: true
          description: Metadata associated with a driver
          additionalProperties:
            nullable: true
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
      required:
        - destination
        - order_handle
        - status
    OrderCountAggregateModel:
      type: object
      properties:
        total:
          type: integer
          description: Total number of orders
        unplanned:
          type: integer
          description: Total unplanned orders
        planned:
          type: integer
          description: Total planned orders
        assigned:
          type: integer
          description: Total assigned orders
        ongoing:
          type: integer
          description: Total ongoing orders
        disabled:
          type: integer
          description: Total disabled  orders
        rescheduled:
          type: integer
          description: Total rescheduled  orders
        completed:
          type: integer
          description: Total completed orders
        cancelled:
          type: integer
          description: Total cancelled orders
        tracked:
          type: integer
          description: Total tracked orders
        on_shift:
          type: integer
          description: Total on_shift orders
        pre_shift:
          type: integer
          description: Total pre_shift orders
        full_shift:
          type: integer
          description: Total full_shift orders
        arrived:
          type: integer
          description: Total arrived orders
        on_time:
          type: integer
          description: Orders that arrived within a 10-minute window of the scheduled time
        worked:
          type: integer
          description: Orders that had a service time within a 45-minute window of the
            expected service time
        ttfe30_orders_from_start:
          type: integer
          description: Orders that received a location event within 30 minutes of the
            start time if no scheduled time is present
        ttfe30_orders_before_schedule_time:
          type: integer
          description: Orders that have received their first event at least 30 minutes
            before the order's scheduled time
      required:
        - arrived
        - assigned
        - cancelled
        - completed
        - disabled
        - full_shift
        - on_shift
        - on_time
        - ongoing
        - planned
        - pre_shift
        - rescheduled
        - total
        - tracked
        - ttfe30_orders_before_schedule_time
        - ttfe30_orders_from_start
        - unplanned
        - worked
    OrderTaskAggregate:
      type: object
      properties:
        total:
          type: integer
          description: Total number of tasks
        status_counts:
          type: object
          description: Counts of tasks by status
          additionalProperties:
            type: integer
      required:
        - status_counts
        - total
    BaseStats:
      type: object
      properties:
        mean:
          type: number
          nullable: true
          description: Average value for the metric
        min:
          type: number
          nullable: true
          description: Minimum value for the metric
        max:
          type: number
          nullable: true
          description: Maximum value for the metric
        stdev:
          type: number
          nullable: true
          description: Standard deviation for the metric
        mean_by_driver:
          type: number
          nullable: true
          description: Average value per worker for the metric
    DriverTotal:
      type: object
      properties:
        total:
          type: integer
          description: Total number of workers
      required:
        - total
    RouteTotal:
      type: object
      properties:
        total:
          type: integer
          description: Total number of routes
      required:
        - total
    OrderOutageSummaryAgg:
      type: object
      properties:
        duration:
          type: integer
          description: Sum total duration of all outages experienced with this `code` in
            the specified time range.
        distance:
          type: integer
          description: Sum total (estimated) distance covered during all outages
            experienced with this `code` in the specified time range.
        code:
          type: string
          description: Code indicating the type of outage
        label:
          type: string
          description: Text indicating the type of outage
        description:
          type: string
          description: Text describing the outage.
        category:
          type: string
          enum:
            - behavioural
            - adversarial
            - reachability
            - os
            - sporadic
          nullable: true
          description: String indicating the category of outage
        duration_in_tracked_orders:
          type: integer
          default: 0
          description: Sum total duration of all outages experienced by tracked orders
            with this `code` in the specified time range.
        duration_in_untracked_orders:
          type: integer
          default: 0
          description: Sum total duration of all outages experienced by untracked orders
            with this `code` in the specified time range.
      required:
        - code
        - description
        - duration
        - label
    OrdersTotalWithTTFE:
      type: object
      properties:
        within_10_min:
          type: integer
          description: Total number of orders where the first device event was received
            within 10 minutes of tracking
        within_20_min:
          type: integer
          description: Total number of orders where the first device event was received
            within 20 minutes of tracking
        within_30_min:
          type: integer
          description: Total number of orders where the first device event was received
            within 30 minutes of tracking.
        within_40_min:
          type: integer
          description: Total number of orders where the first device event was received
            within 40 minutes of tracking.
        within_50_min:
          type: integer
          description: Total number of orders where the first device event was received
            within 50 minutes of tracking.
        within_60_min:
          type: integer
          description: Total number of orders where the first device event was received
            within 60 minutes of tracking.
        within_70_min:
          type: integer
          description: Total number of orders where the first device event was received
            within 70 minutes of tracking.
        within_80_min:
          type: integer
          description: Total number of orders where the first device event was received
            within 80 minutes of tracking.
        within_90_min:
          type: integer
          description: Total number of orders where the first device event was received
            within 90 minutes of tracking.
      required:
        - within_10_min
        - within_20_min
        - within_30_min
        - within_40_min
        - within_50_min
        - within_60_min
        - within_70_min
        - within_80_min
        - within_90_min
    OrderAggregate:
      type: object
      properties:
        orders:
          description: Fields containing status level count of orders along with total
            orders.
          allOf:
            - $ref: "#/components/schemas/OrderCountAggregateModel"
        tasks:
          nullable: true
          description: Fields containing status level count of tasks along with total tasks.
          allOf:
            - $ref: "#/components/schemas/OrderTaskAggregate"
        distance:
          nullable: true
          description: Stats related to the orders distance
          allOf:
            - $ref: "#/components/schemas/BaseStats"
        duration:
          nullable: true
          description: Stats related to the orders duration
          allOf:
            - $ref: "#/components/schemas/BaseStats"
        tracked_duration:
          type: integer
          nullable: true
          description: Total Tracked duration for the orders
        active_duration:
          type: integer
          nullable: true
          description: Active duration for the orders
        deviation:
          nullable: true
          description: Stats related to the orders deviation
          allOf:
            - $ref: "#/components/schemas/BaseStats"
        service_time:
          nullable: true
          description: Stats related to the orders service time
          allOf:
            - $ref: "#/components/schemas/BaseStats"
        completion_delay:
          nullable: true
          description: Stats related to the orders completion delay
          allOf:
            - $ref: "#/components/schemas/BaseStats"
        drivers:
          nullable: true
          description: Total number of drivers
          deprecated: true
          allOf:
            - $ref: "#/components/schemas/DriverTotal"
        workers:
          nullable: true
          description: Total number of workers
          allOf:
            - $ref: "#/components/schemas/DriverTotal"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            all orders combined. Values lie between 0.0 and 1.0
        routes:
          nullable: true
          description: Total number of routes
          allOf:
            - $ref: "#/components/schemas/RouteTotal"
        outage_summary:
          type: array
          nullable: true
          description: List of outages experienced during the specified time range.
          items:
            $ref: "#/components/schemas/OrderOutageSummaryAgg"
        orders_count_with_ttfe:
          nullable: true
          description: Orders aggregation metrics based on their first device event.
          allOf:
            - $ref: "#/components/schemas/OrdersTotalWithTTFE"
      required:
        - orders
    GetOrdersResponse:
      type: object
      properties:
        orders:
          type: array
          nullable: true
          description: ""
          items:
            $ref: "#/components/schemas/OrderResponse"
        pagination_token:
          type: string
          nullable: true
          description: ""
        aggregate:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/OrderAggregate"
    OrderListPolygonDestination:
      type: object
      properties:
        geometry:
          description: GeoJSON representation of polygon geometry for the order destination
          allOf:
            - $ref: "#/components/schemas/PolygonGeometry"
        address:
          type: string
          nullable: true
          description: Address for the order destination
        geofence_id:
          type: string
          nullable: true
          description: Geofence ID of the order destination
        place_handle:
          type: string
          nullable: true
          description: Place Handle of the order destination
        place_id:
          type: string
          nullable: true
          description: Place ID of the order destination
      required:
        - geometry
    OrderListPointDestination:
      type: object
      properties:
        geometry:
          description: GeoJSON representation of point geometry for the order destination
          allOf:
            - $ref: "#/components/schemas/PointGeometry"
        address:
          type: string
          nullable: true
          description: Address for the order destination
        geofence_id:
          type: string
          nullable: true
          description: Geofence ID of the order destination
        place_handle:
          type: string
          nullable: true
          description: Place Handle of the order destination
        place_id:
          type: string
          nullable: true
          description: Place ID of the order destination
        radius:
          type: integer
          default: 100
          description: Radius (in meters) of the circular geofence representing the order
            destination, typically between 25m and 200m
      required:
        - geometry
    OrderListGeofenceIdDestination:
      type: object
      properties:
        geofence_id:
          type: string
          description: Geofence ID to extract geometry from. This is a legacy feature,
            prefer using `place_handle` now
          deprecated: true
        address:
          type: string
          nullable: true
          description: Address for the order destination
      required:
        - geofence_id
    OrderListPlaceHandleDestination:
      type: object
      properties:
        place_handle:
          type: string
          description: Place Handle to extract geometry from
        address:
          type: string
          nullable: true
          description: Address for the order destination
      required:
        - place_handle
    OrderAddressDestination:
      type: object
      properties:
        address:
          type: string
          minLength: 1
          description: Address for the order destination
        radius:
          type: integer
          default: 30
          description: Radius (in meters) of the circular geofence representing the order
            destination, typically between 25m and 200m
      required:
        - address
    BaseOrderTask:
      type: object
      properties:
        label:
          type: string
          description: Type of task to be created for the order.
        task_definition_id:
          type: string
          nullable: true
          description: Id of the tasks definition from which this task is picked
        description:
          type: string
          nullable: true
          description: Description of the task type.
        metadata:
          type: object
          nullable: true
          description: Additional metadata for the task.
          additionalProperties:
            nullable: true
        priority:
          type: string
          enum:
            - none
            - low
            - medium
            - high
          nullable: true
          description: Priority of the task. Valid values are none, low, medium, high.
      required:
        - label
    OrderTaskList:
      type: object
      properties:
        task_definition_id:
          type: string
          nullable: true
          description: Id of task definiton from where to copy tasks to this order
        tasks:
          type: array
          nullable: true
          description: List of additional task that need to be performed in the order
          items:
            $ref: "#/components/schemas/BaseOrderTask"
    BaseOrderApproval:
      type: object
      properties:
        worker_handle:
          type: string
          description: Handle of the worker associated with this approval
        approver_id:
          type: string
          description: ID of the user who should approve this request
        reason:
          type: string
          nullable: true
          description: Reason for requiring approval
      required:
        - approver_id
        - worker_handle
    BaseOrderAcceptance:
      type: object
      properties:
        worker_handle:
          type: string
          description: Handle of the worker associated with this acceptance
        creator_id:
          type: string
          description: ID of the user/system creating this acceptance
        reason:
          type: string
          nullable: true
          description: Reason / context for acceptance
      required:
        - creator_id
        - worker_handle
    OrderRequest:
      type: object
      properties:
        order_handle:
          type: string
          minLength: 1
          description: Unique handle for Order
        destination:
          description: Object representing destination of the order
          oneOf:
            - $ref: "#/components/schemas/OrderListPolygonDestination"
            - $ref: "#/components/schemas/OrderListPointDestination"
            - $ref: "#/components/schemas/OrderListGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderListPlaceHandleDestination"
            - $ref: "#/components/schemas/OrderAddressDestination"
        scheduled_at:
          type: string
          description: Schedule time by which order needs to be fulfilled
        scheduled_after:
          type: string
          nullable: true
          description: Schedule time after which the worker needs to fulfill order
            (similar to slot start)
        expected_service_time:
          type: integer
          nullable: true
          description: Specified in seconds.
        metadata:
          type: object
          nullable: true
          description: Metadata for order
          additionalProperties:
            nullable: true
        product_type:
          type: array
          nullable: true
          description: Array of string representing skills required to fulfill the order
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Type of Order
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order.
        type_index:
          type: integer
          nullable: true
          description: Type index of the order, used in pick/drop scenario
        tasks_list:
          nullable: true
          description: List of task associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderTaskList"
        approvals:
          type: array
          nullable: true
          description: List of approvals for the order. Will take effect only in case of
            unplanned orders.
          items:
            $ref: "#/components/schemas/BaseOrderApproval"
        acceptances:
          type: array
          nullable: true
          description: List of acceptances for the order. Will take effect only in case of
            unplanned orders.
          items:
            $ref: "#/components/schemas/BaseOrderAcceptance"
        capacity_used:
          type: integer
          default: 1
          nullable: true
          description: Volumetric units which is to be occupied by the order
      required:
        - destination
        - order_handle
        - scheduled_at
    BatchOrdersRequest:
      type: object
      properties:
        ops_group_handle:
          type: string
          nullable: true
          description: Unique Handle of Ops Group to plan orders for
        orders:
          type: array
          minItems: 1
          description: List of Orders which are to be planned
          items:
            $ref: "#/components/schemas/OrderRequest"
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          description: >-
            - `scheduled` mode allows customers to batch and sequence future
            orders into routes for worker based on their availability. This mode
            operates only on the upcoming routes (if exist), but does not
            re-plan ongoing routes.

            - `manual` mode allows customers to ingest orders into HT which are
            to be planned manually.<ul> <li> If `worker_handle` is provided,
            hypertrack will create a new route for the specified worker with the
            posted orders in the provided sequence.</li> <li> In case
            `worker_handle` is not given, then hypertrack will ingest orders
            into system to facilitate further planning.</li></ul> 

            - `on_demand` mode is to facilitate the use case where an order
            needs to be planned on top of an existing plan, here <ul><li> if
            `worker_handle` is provided, then the order will be assigned to that
            worker, either optimally adjusted into his/her existing route (if
            present) OR a new route is created for the worker.</li> <li> If
            `worker_handle` is not provided, then the order either gets adjusted
            to one of the available worker's route in the most optimal manner OR
            is added to a new route. In both scenarios, order planning makes
            sure Order SLAs are met. On demand mode works for future as well as
            live routes.</li></ul>
        driver_handle:
          type: string
          nullable: true
          description: Driver handle to which order will be assigned to.
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Worker handle to which order will be assigned to.
        enable_sync_planning:
          type: boolean
          default: false
          nullable: true
          description: Flag to enable synchronous planning when the plan mode is
            on_demand. For scheduled mode, planning is always performed
            asynchronously.
        route_solver_matrix_strategy:
          default: osrm_full
          enum:
            - osrm_full
            - als_full
            - hybrid_sparse
          description: "Strategy to use for route solver. Options: osrm_full, als_full,
            hybrid_sparse"
      required:
        - orders
        - plan_mode
    RouteOrder:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          enum:
            - planned
            - assigned
            - dispatched
            - ongoing
            - disabled
            - cancelled
            - completed
            - summarizing
            - unplanned
          description: Current state of the order - `unplanned`, `planned`, `assigned`,
            `ongoing`, `completed`, `cancelled`
        destination:
          description: Destination for the order
          allOf:
            - $ref: "#/components/schemas/OrderDestinationSpecialType"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the orders in the
            route are associated
        plan_mode:
          enum:
            - on_demand
            - scheduled
            - pool
            - manual
          nullable: true
          description: Value indicating how the order was planned - `on_demand`, `manual`,
            `scheduled`
        plan_id:
          type: string
          nullable: true
          description: Order plans identifier
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            nullable: true
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify the index of type
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderListEstimate"
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        track_mode:
          enum:
            - on_time
            - flex
            - on_shift
            - pre_shift
            - full_shift
          nullable: true
          description: Value representing whether the order is tracked in on_shift,
            pre_shift or full_shift mode. Modes such as `on_time` and `flex` are
            deprecated.
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver was tracked at the location when
            fulfilling the order
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after order start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after order
            start
        created_by:
          nullable: true
          description: Source of the order creation. This can be a user, system, or any
            other entity responsible for creating the order.
          allOf:
            - $ref: "#/components/schemas/Source"
        outage_summary:
          type: array
          nullable: true
          description: List of outages experienced during the specified time range.
          items:
            $ref: "#/components/schemas/OrderOutageSummary"
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Order is expected to switch device
        tasks:
          type: array
          nullable: true
          description: List of tasks associated with the order.
          items:
            $ref: "#/components/schemas/OrderTask"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order.
        worker_profile:
          type: object
          nullable: true
          description: Metadata associated with a driver
          additionalProperties:
            nullable: true
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
      required:
        - destination
        - order_handle
        - status
    EstimatePolyline:
      type: object
      properties:
        type:
          type: string
          description: Type of GeoJSON feature. It will always be `LineString` for polyline
        coordinates:
          type: array
          description: GeoJSON representation of LineString coordinates, inner list
            element is represented as [longitude, latitude]
          items:
            type: array
            items:
              nullable: true
      required:
        - coordinates
        - type
    RouteDetailEstimate:
      type: object
      properties:
        start_by:
          type: string
          nullable: true
          description: "Estimated timestamp by which a driver should start travelling to
            fulfill all route orders on time "
        distance:
          type: integer
          description: Estimated total distance that the driver should travel in the route
        duration:
          type: integer
          description: Estimated total time that the driver should spend to fulfill all
            orders in the route
        polyline:
          description: Estimated optimal path that the driver should take to fulfill all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/EstimatePolyline"
        start_location:
          nullable: true
          description: The starting point location from where the driver begins their
            journey for the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: The final destination location where the route ends after
            completing all orders
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
      required:
        - distance
        - duration
        - polyline
    Polyline:
      type: object
      properties:
        type:
          type: string
          description: Type of GeoJSON feature. It will always be `LineString` for polyline
        coordinates:
          type: array
          description: GeoJSON representation of LineString coordinates, inner list
            element is represented as [longitude, latitude, altitude,
            recorded_at]
          items:
            type: array
            items:
              nullable: true
      required:
        - coordinates
        - type
    RouteDetail:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    Plan:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the plan
        href:
          type: string
          description: Endpoint path to use to get the latest plan status
      required:
        - href
        - id
    PlanResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        message:
          type: string
          nullable: true
          description: Message on the status of planning. Provided if the request does not
            have plan_mode as `manual`
        plan:
          nullable: true
          description: Information about asynchronous planning of the orders provided
          allOf:
            - $ref: "#/components/schemas/Plan"
      title: PlanResponse
    OrderListResponse:
      type: object
      properties:
        orders:
          type: array
          nullable: true
          description: ""
          items:
            $ref: "#/components/schemas/OrderResponse"
      title: OrderList
    ImageAttachment:
      type: object
      properties:
        type:
          enum:
            - image
          description: Type of attachment
        url:
          type: string
          description: Image link
        caption:
          type: string
          nullable: true
          description: Caption for the image
      required:
        - type
        - url
    NoteAttachment:
      type: object
      properties:
        type:
          enum:
            - note
          description: Type of attachment
        data:
          type: string
          description: Text for the note
      required:
        - data
        - type
    SignatureAttachment:
      type: object
      properties:
        type:
          enum:
            - signature
          description: Type of attachment
        url:
          type: string
          description: Signature image link
      required:
        - type
        - url
    ServiceStatsInfo:
      type: object
      properties:
        duration:
          type: integer
          nullable: true
          description: Duration to be tracked for the order
        distance:
          type: integer
          nullable: true
          description: Duration to be tracked for the order
        outage_duration:
          type: integer
          nullable: true
          description: Duration to be tracked for the order
        outage:
          type: object
          nullable: true
          description: Duration to be tracked for the order
          additionalProperties:
            nullable: true
        tracking_rate:
          type: number
          nullable: true
          description: Driver tracking rate during the lifespan of the visit
    EnrouteStatsInfo:
      type: object
      properties:
        duration:
          type: integer
          nullable: true
          description: Duration to be tracked for the order
        distance:
          type: integer
          nullable: true
          description: Duration to be tracked for the order
        idle_time:
          type: integer
          nullable: true
          description: Duration to be tracked for the order
        outage_duration:
          type: integer
          nullable: true
          description: Duration to be tracked for the order
        outage_distance:
          type: integer
          nullable: true
          description: Outage distance for the visit
        outage:
          type: object
          nullable: true
          description: Duration to be tracked for the order
          additionalProperties:
            nullable: true
        tracking_rate:
          type: number
          nullable: true
          description: Driver tracking rate during the lifespan of the visit
    LocationGeometry:
      type: object
      properties:
        type:
          type: string
          enum:
            - Point
          description: Geometry type
        coordinates:
          type: array
          description: Location coordinates represented as [longitude, latitude]
          items:
            type: number
      required:
        - coordinates
        - type
    LocationInfo:
      type: object
      properties:
        location:
          nullable: true
          description: Location for the visit
          allOf:
            - $ref: "#/components/schemas/LocationGeometry"
        recorded_at:
          type: string
          description: Recorded timestamp
        location_accuracy:
          type: number
          nullable: true
          description: Location accuracy in meters
      required:
        - recorded_at
    AnyLocationGeometry:
      type: object
      properties:
        type:
          type: string
          enum:
            - Point
            - Polygon
          description: Geometry type
        coordinates:
          type: array
          description: Location coordinates represented as [longitude, latitude] or
            [[[longitude, latitude],..]]
          items:
            nullable: true
      required:
        - coordinates
        - type
    VisitGeometryModel:
      type: object
      properties:
        radius:
          type: integer
          description: Radius of visit's location in case of point type
        geometry:
          description: Location for the visit
          allOf:
            - $ref: "#/components/schemas/AnyLocationGeometry"
      required:
        - geometry
        - radius
    ImageAttachment1:
      type: object
      properties:
        type:
          type: string
          enum:
            - image
          description: Type of attachment
        url:
          type: string
          description: Image link
        caption:
          type: string
          nullable: true
          description: Caption for the image
        attachment_id:
          type: string
          nullable: true
      required:
        - type
        - url
    NoteAttachment1:
      type: object
      properties:
        type:
          type: string
          enum:
            - note
          description: Type of attachment
        data:
          type: string
          description: Text for the note
        attachment_id:
          type: string
          nullable: true
      required:
        - data
        - type
    SignatureAttachment1:
      type: object
      properties:
        type:
          type: string
          enum:
            - signature
          description: Type of attachment
        url:
          type: string
          description: Signature image link
        attachment_id:
          type: string
          nullable: true
      required:
        - type
        - url
    Visit:
      type: object
      properties:
        visit_id:
          type: string
          format: uuid
          description: Unique identifier representing each visit.
        created_at:
          type: string
          description: Creation timestamp of visit
        updated_at:
          type: string
          nullable: true
          description: Last Updated timestamp of visit
        geofence_id:
          type: string
          format: uuid
          description: GeofenceId associated with visit
        driver_handle:
          type: string
          deprecated: true
          description: Driver handle for this visit
        worker_handle:
          type: string
          description: Worker handle for this visit
        worker_name:
          type: string
          nullable: true
          description: Worker name for this visit
        worker_profile:
          type: object
          nullable: true
          description: Worker profile associated with visit.
          additionalProperties:
            nullable: true
        device_id:
          type: string
          format: uuid
          nullable: true
          description: Device id associated with visit
        order_handle:
          type: string
          description: Order handle for this visit
        place_handle:
          type: string
          nullable: true
          description: Place handle for this visit
        ops_group_handle:
          type: string
          description: Ops Group handle for this visit
        arrival:
          nullable: true
          description: Arrival information of visit
          allOf:
            - $ref: "#/components/schemas/LocationInfo"
        exit:
          nullable: true
          description: Exited information of visit
          allOf:
            - $ref: "#/components/schemas/LocationInfo"
        enroute:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/EnrouteStatsInfo"
        service:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/ServiceStatsInfo"
        metadata:
          type: object
          nullable: true
          description: Metadata associated with this visit.
          additionalProperties:
            nullable: true
        geofence_metadata:
          type: object
          nullable: true
          description: Geofence Metadata associated with the visit.
          additionalProperties:
            nullable: true
        tracking_rate:
          type: number
          description: Driver tracking rate during the lifespan of the order
        system_generated_order_handle:
          type: boolean
          nullable: true
          description: Boolean to filter out orders where order handle was automatically
            generated by HT system
        visit_geometry:
          nullable: true
          description: Geometry of the visit
          allOf:
            - $ref: "#/components/schemas/VisitGeometryModel"
        geofence_address:
          type: string
          nullable: true
          description: Geofence address for this visit
        timezone:
          type: string
          nullable: true
          description: Timezone associated with this visit
        attachments:
          type: array
          nullable: true
          description: Attachments associated with this geotag
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
      required:
        - created_at
        - geofence_id
        - ops_group_handle
        - order_handle
        - visit_id
    VisitOrder:
      type: object
      properties:
        order_handle:
          type: string
          description: String representing the order
        service:
          description: Visit Order's details while in service
          allOf:
            - $ref: "#/components/schemas/ServiceStatsInfo"
        enroute:
          description: Visit Order's details during enroute
          allOf:
            - $ref: "#/components/schemas/EnrouteStatsInfo"
        driver_handle:
          type: string
          deprecated: true
          description: String representing the handle for the driver
        tracking_rate:
          type: number
          description: Tracking rate during the lifespan of the order
        worker_handle:
          type: string
          description: String representing the handle for the worker
        system_generated_order_handle:
          type: boolean
          nullable: true
          description: Boolean to filter out orders where order handle was automatically
            generated by HT system
        ops_group_handle:
          type: string
          description: String representing the ops group handle
        visits:
          type: array
          description: List of visits associated with order
          items:
            $ref: "#/components/schemas/Visit"
      required:
        - enroute
        - order_handle
        - service
    VisitsAggregate:
      type: object
      properties:
        count:
          type: integer
          description: Number of geotags generated in the given time range
    WorkersAggregate:
      type: object
      properties:
        count:
          type: integer
          description: Total number of drivers
    VisitOrderAggregate:
      type: object
      properties:
        count:
          type: integer
          description: Number of orders generated in the given time range
        tracking_rate:
          type: number
          description: Tracking rate of the driver during the lifespan of the orders
        visits:
          description: Aggregate information for visits
          allOf:
            - $ref: "#/components/schemas/VisitsAggregate"
        workers:
          description: Aggregate information for workers
          allOf:
            - $ref: "#/components/schemas/WorkersAggregate"
      required:
        - count
    GetVisitsResponse:
      type: object
      properties:
        orders:
          type: array
          nullable: true
          description: Array of Orders fulfilled in the given time range
          items:
            $ref: "#/components/schemas/VisitOrder"
        pagination_token:
          type: string
          nullable: true
          description: Identifier used to fetch the next page of data
        aggregate:
          nullable: true
          description: Combined aggregate metrics for visits and orders in the given time
            range
          allOf:
            - $ref: "#/components/schemas/VisitOrderAggregate"
    LocationWithoutRadius:
      type: object
      properties:
        address:
          type: string
          nullable: true
          description: Address for the location
        geometry:
          nullable: true
          description: Location geometry
          allOf:
            - $ref: "#/components/schemas/LocationGeometry"
    ActivitySummary:
      type: object
      properties:
        duration:
          type: integer
          description: Time duration in seconds worker spent during the activity
        count:
          type: integer
          description: Number of times the worker was observed in the activity
      required:
        - count
        - duration
    DriveSummary:
      type: object
      properties:
        duration:
          type: integer
          description: Time duration in seconds worker spent during the activity
        count:
          type: integer
          description: Number of times the worker was observed in the activity
        distance:
          type: integer
          description: Distance covered by the worker while driving
      required:
        - count
        - distance
        - duration
    GeotagTrackingSummary:
      type: object
      properties:
        stop:
          nullable: true
          description: Tracking summary of stops during the geotag lifespan.
          allOf:
            - $ref: "#/components/schemas/ActivitySummary"
        walk:
          nullable: true
          description: Tracking summary of walks during the geotag lifespan.
          allOf:
            - $ref: "#/components/schemas/ActivitySummary"
        drive:
          nullable: true
          description: Tracking summary of drives during the geotag lifespan.
          allOf:
            - $ref: "#/components/schemas/DriveSummary"
    Geotag:
      type: object
      properties:
        geotag_id:
          type: string
          format: uuid
          description: Unique ID to identify a geotag
        driver_handle:
          type: string
          description: String representing the handle for the driver
          deprecated: true
        worker_handle:
          type: string
          description: String representing the handle for the worker
        recorded_at:
          type: string
          description: ISO 8601 date when the geotag was created
        device_id:
          type: string
          format: uuid
          description: String representing the ID of the device
        metadata:
          type: object
          description: Optional metadata associated with the geotag
          additionalProperties:
            nullable: true
        location:
          description: Geometry location for a geotag
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadius"
        place_handle:
          type: string
          description: String representing the handle for the worker
        expected_location:
          description: Expected Geometry location for a geotag
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadius"
        start_location:
          description: Starting Geometry location point for a geotag
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadius"
        region:
          description: Region for a geotag
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          description: Distance from the tracking start for the geotag
        duration:
          type: integer
          description: Time taken from start location to this geotag location
        deviation:
          type: integer
          description: Haversine deviation in meters from the expected location
        tracking_rate:
          type: number
          description: Driver tracking rate during the lifespan of the geotag
        geotag_type:
          type: string
          description: String representing type of Geotag
        order_handle:
          type: string
          description: String representing order handle with which the geotag is associated
        driver_name:
          type: string
          description: String representing the name of the driver
        ops_group_handle:
          type: string
          description: String representing the ops group handle
        system_generated_order_handle:
          type: boolean
          description: Boolean representing whether the handle was automatically generated
            by HT system or not
        timezone:
          type: string
          nullable: true
          description: Timezone associated with this geotag
        attachments:
          type: array
          nullable: true
          description: Attachments associated with this geotag
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        tracking_summary:
          nullable: true
          description: Tracking summary of activities during the lifespan of geotag
          allOf:
            - $ref: "#/components/schemas/GeotagTrackingSummary"
      required:
        - device_id
        - geotag_id
        - location
        - recorded_at
    GeotagOrder:
      type: object
      properties:
        order_handle:
          type: string
          description: String representing the order
        last_geotag_recorded_at:
          type: string
          description: ISO 8601 date when the last geotag for the order was created
        distance:
          type: integer
          description: Distance travelled for the order
        duration:
          type: integer
          description: Duration to be tracked for the order
        driver_handle:
          type: string
          description: String representing the handle for the driver
          deprecated: true
        worker_handle:
          type: string
          description: String representing the handle for the worker
        driver_name:
          type: string
          description: String representing the name of the driver
          deprecated: true
        worker_name:
          type: string
          description: String representing the name of the driver
        device_id:
          type: string
          format: uuid
          description: String representing the ID of the device
        tracking_rate:
          type: number
          description: Driver tracking rate during the lifespan of the order
        ops_group_handle:
          type: string
          description: String representing the ops group handle
        system_generated_order_handle:
          type: boolean
          description: Boolean representing whether the handle was automatically generated
            by HT system or sent along with geotag data
        geotags:
          type: array
          description: List of geotags associated with order
          items:
            $ref: "#/components/schemas/Geotag"
      required:
        - device_id
        - distance
        - duration
        - last_geotag_recorded_at
        - order_handle
        - system_generated_order_handle
    GeotagStats:
      type: object
      properties:
        mean:
          type: number
          nullable: true
          description: Average value for the metric
        min:
          type: number
          nullable: true
          description: Minimum value for the metric
        max:
          type: number
          nullable: true
          description: Maximum value for the metric
        stdev:
          type: number
          nullable: true
          description: Standard deviation for the metric
        mean_by_driver:
          type: number
          nullable: true
          description: Average value per worker for the metric
        sum:
          type: number
          description: Total value of the metric
      required:
        - sum
    GeotagAggregate:
      type: object
      properties:
        count:
          type: integer
          description: Number of geotags generated in the given time range
        count_mean:
          type: number
          description: Mean number of geotags in an order in the given time range
    DriversAggregate:
      type: object
      properties:
        count:
          type: integer
          description: Total number of drivers
    GeotagOrderAggregate:
      type: object
      properties:
        count:
          type: integer
          description: Number of orders generated in the given time range
        distance:
          description: Stats related to the orders distance
          allOf:
            - $ref: "#/components/schemas/GeotagStats"
        duration:
          description: Stats related to the orders duration in second
          allOf:
            - $ref: "#/components/schemas/GeotagStats"
        active_duration:
          description: Stats related to the orders active duration in second
          allOf:
            - $ref: "#/components/schemas/GeotagStats"
        outage_duration:
          description: Stats related to the orders outage duration in second
          allOf:
            - $ref: "#/components/schemas/GeotagStats"
        tracking_rate:
          type: number
          description: Tracking rate of the driver during the lifespan of the orders
        deviation:
          description: Stats related to the geotag deviation
          allOf:
            - $ref: "#/components/schemas/GeotagStats"
        geotags:
          description: Aggregate information of geotags
          allOf:
            - $ref: "#/components/schemas/GeotagAggregate"
        drivers:
          description: Aggregate information of drivers
          deprecated: true
          allOf:
            - $ref: "#/components/schemas/DriversAggregate"
        workers:
          description: Aggregate information of workers
          allOf:
            - $ref: "#/components/schemas/DriversAggregate"
        outage_summary:
          type: array
          nullable: true
          description: List of outages experienced during the specified time range.
          items:
            $ref: "#/components/schemas/OrderOutageSummary"
      required:
        - count
    GetGeotagsResponse:
      type: object
      properties:
        orders:
          type: array
          nullable: true
          description: Array of Orders fulfilled in the given time range
          items:
            $ref: "#/components/schemas/GeotagOrder"
        pagination_token:
          type: string
          nullable: true
          description: Identifier used to fetch the next page of data
        aggregate:
          nullable: true
          description: Combined aggregate metrics for geotags and orders in the given time
            range
          allOf:
            - $ref: "#/components/schemas/GeotagOrderAggregate"
    DriverDateSchedule:
      type: object
      properties:
        start_time:
          type: string
          description: Start time represented by HH:mm of the worker's day schedule
        end_time:
          type: string
          description: End time represented by HH:mm of the worker's day schedule
        date:
          type: string
          description: Date on which the worker is available for work
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for an Ops Group
        priority:
          type: integer
          nullable: true
          description: Priority of schedule of a worker
      required:
        - date
        - end_time
        - start_time
    DriverRecurringSchedule:
      type: object
      properties:
        start_time:
          type: string
          description: Start time represented by HH:mm of the worker's day schedule
        end_time:
          type: string
          description: End time represented by HH:mm of the worker's day schedule
        day_of_week:
          type: string
          enum:
            - SUNDAY
            - MONDAY
            - TUESDAY
            - WEDNESDAY
            - THURSDAY
            - FRIDAY
            - SATURDAY
          description: Day of the week when the worker is available for work
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for an Ops Group
        priority:
          type: integer
          nullable: true
          description: Priority of schedule of a worker
      required:
        - day_of_week
        - end_time
        - start_time
    LocationWithoutRadiusResponse:
      type: object
      properties:
        address:
          type: string
          nullable: true
          description: Address for the location
        geometry:
          description: Location geometry
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
      required:
        - geometry
    MovementLocationResponse:
      type: object
      properties:
        geometry:
          description: Location geometry
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        accuracy:
          type: number
          nullable: true
          description: Accuracy in meters for the location
        bearing:
          type: number
          nullable: true
          description: Directional position in degrees for the location
        speed:
          type: number
          nullable: true
          description: Speed in meters per second at this location
        recorded_at:
          type: string
          nullable: true
          description: Timestamp associated with the last known location of the worker.
      required:
        - geometry
    DeviceStatus:
      type: object
      properties:
        value:
          type: string
          description: Status of the driver's device - `active` `disconnected` `inactive`
            `available` `unavailable`
        data:
          type: object
          description: Data associated with the driver's device status - `reason`,
            `activity`
          additionalProperties:
            nullable: true
      required:
        - data
        - value
    DriverOutageSummary:
      type: object
      properties:
        code:
          type: string
          description: Code indicating the type of outage
        label:
          type: string
          description: Text indicating the type of outage
        description:
          type: string
          description: Text describing the outage.
        category:
          type: string
          enum:
            - behavioural
            - adversarial
            - reachability
            - os
            - sporadic
          description: String indicating the category of outage
        duration:
          type: integer
          description: Sum total duration of all outages experienced with this `code` in
            the specified time range.
        distance:
          type: integer
          description: Sum total (estimated) distance covered during all outages
            experienced with this `code` in the specified time range.
      required:
        - category
        - code
        - description
        - distance
        - duration
        - label
    DeviceInfo:
      type: object
      properties:
        timezone:
          type: string
          description: Timezone of the device
        os_name:
          type: string
          description: Operating system running on the device
        device_brand:
          type: string
          description: Brand of the device
        sdk_version:
          type: string
          description: HyperTrack SDK version used on the device
        device_model:
          type: string
          description: Model of the device
        network_operator:
          type: string
          nullable: true
          description: Network operator used by the device
        os_version:
          type: string
          description: Operating system version on the device
        os_hardware_identifier:
          type: string
          description: Hardware identification number for the device
        app_name:
          type: string
          description: App name on the device
        app_version_string:
          type: string
          nullable: true
          description: App version used on the device
        app_version_number:
          type: string
          nullable: true
          description: App version number used on the device
      required:
        - app_name
        - device_brand
        - device_model
        - os_hardware_identifier
        - os_name
        - os_version
        - sdk_version
        - timezone
    GeotagsAggregate:
      type: object
      properties:
        count:
          type: integer
          description: Number of geotags generated in the given time range
        distance:
          nullable: true
          description: Stats related to workers' distance
          allOf:
            - $ref: "#/components/schemas/GeotagStats"
        duration:
          nullable: true
          description: Stats related to workers' duration
          allOf:
            - $ref: "#/components/schemas/GeotagStats"
        deviation:
          nullable: true
          description: Stats related to the geotag deviation
          allOf:
            - $ref: "#/components/schemas/GeotagStats"
      required:
        - count
    CountGroup:
      type: object
      properties:
        total:
          type: integer
          description: Total number of orders
        completed:
          type: integer
          nullable: true
          description: Total number of completed orders
        cancelled:
          type: integer
          nullable: true
          description: Total number of cancelled orders
        assigned:
          type: integer
          nullable: true
          description: Total number of assigned orders
        tracked:
          type: integer
          nullable: true
          description: Total number of tracked orders
      required:
        - total
    OrderStats:
      type: object
      properties:
        mean:
          type: number
          nullable: true
          description: Average value for the metric
        min:
          type: number
          nullable: true
          description: Minimum value for the metric
        max:
          type: number
          nullable: true
          description: Maximum value for the metric
        stdev:
          type: number
          nullable: true
          description: Standard deviation for the metric
        mean_by_driver:
          type: number
          nullable: true
          description: Average value per worker for the metric
        sum:
          type: number
          description: Total value of the metric
      required:
        - sum
    OrdersAggregate:
      type: object
      properties:
        count:
          description: Count related to the orders
          allOf:
            - $ref: "#/components/schemas/CountGroup"
        distance:
          nullable: true
          description: Stats related to workers' distance
          allOf:
            - $ref: "#/components/schemas/OrderStats"
        duration:
          nullable: true
          description: Stats related to workers' duration
          allOf:
            - $ref: "#/components/schemas/OrderStats"
        deviation:
          nullable: true
          description: Stats related to the geotag deviation
          allOf:
            - $ref: "#/components/schemas/OrderStats"
      required:
        - count
    DriversAggregate1:
      type: object
      properties:
        total:
          type: integer
          nullable: true
          description: Total number of workers matching applied filters
        total_intended_to_track:
          type: integer
          nullable: true
          description: Workers expected to be tracked during the period
        worked:
          type: integer
          nullable: true
          description: Workers who performed work (orders, geotags, or visits)
        tracked:
          type: integer
          nullable: true
          description: Workers successfully tracked during the period
        untracked:
          type: integer
          nullable: true
          description: Workers with tracking intent but failed due to actionable outage
        disconnected:
          type: integer
          nullable: true
          description: Workers with tracking intent but failed without actionable outage
        tracked_not_worked:
          type: integer
          nullable: true
          description: Workers tracked but with no work activity
    SummaryAggregate:
      type: object
      properties:
        tracked_duration:
          type: integer
          nullable: true
          description: Total tracked duration of all workers.
        tracked_distance:
          type: integer
          nullable: true
          description: Total tracked distance of all workers.
        outage_duration:
          type: integer
          nullable: true
          description: Total outage duration of all workers.
        outage_distance:
          type: integer
          nullable: true
          description: Total outage distance of all workers.
        drive_duration:
          type: integer
          nullable: true
          description: Total drive duration of all workers.
        stop_duration:
          type: integer
          nullable: true
          description: Total stop duration of all workers.
        walk_duration:
          type: integer
          nullable: true
          description: Total walk duration of all workers.
    DriverOutageSummaryAggregate:
      type: object
      properties:
        code:
          type: string
          description: Code indicating the type of outage
        label:
          type: string
          description: Text indicating the type of outage
        description:
          type: string
          description: Text describing the outage.
        category:
          type: string
          enum:
            - behavioural
            - adversarial
            - reachability
            - os
            - sporadic
          description: String indicating the category of outage
        duration:
          type: integer
          description: Total duration of all instances of concerned outage.
        duration_untracked:
          type: integer
          description: Total duration of all instances of concerned outage observed for
            untracked workers.
        duration_tracked:
          type: integer
          description: Total duration of all instances of concerned outage observed for
            tracked workers.
        distance:
          type: integer
          description: Estimated distance covered during all instances of concerned outage.
      required:
        - category
        - code
        - description
        - distance
        - duration
        - duration_tracked
        - duration_untracked
        - label
    LocationPermissionStateCounts:
      type: object
      properties:
        always:
          type: integer
        foreground_only:
          type: integer
        never:
          type: integer
        unknown:
          type: integer
      required:
        - always
        - foreground_only
        - never
        - unknown
    VisitAggregateModel:
      type: object
      properties:
        count:
          type: integer
          description: Number of visits in the given time range
      required:
        - count
    LocationWithoutRadius1:
      type: object
      properties:
        address:
          type: string
          nullable: true
          description: Address for the location
        geometry:
          nullable: true
          description: Location geometry
          allOf:
            - $ref: "#/components/schemas/LocationGeometry"
    DriverStatus1:
      type: object
      properties:
        tracking:
          type: boolean
          description: Flag indicating whether the worker is currently on work
        available:
          type: boolean
          description: Flag indicating if the worker is available for work
      required:
        - available
        - tracking
    DeviceStatus1:
      type: object
      properties:
        value:
          type: string
          description: Status of the worker's device - `active` `disconnected` `inactive`
        data:
          type: object
          description: Data associated with the worker's device status - `reason`,
            `activity`
          additionalProperties:
            nullable: true
      required:
        - data
        - value
    OrderSummary1:
      type: object
      properties:
        total:
          type: integer
          description: Total orders
        completed:
          type: integer
          description: Orders completed
        cancelled:
          type: integer
          description: Orders cancelled
        tracked:
          type: integer
          description: Orders currently being tracked
        assigned:
          type: integer
          description: Orders assigned
        completed_tasks:
          type: integer
          description: Order tasks completed
      required:
        - assigned
        - cancelled
        - completed
        - completed_tasks
        - total
        - tracked
    DriverOutageSummary1:
      type: object
      properties:
        code:
          type: string
          description: Code indicating the type of outage
        label:
          type: string
          description: Text indicating the type of outage
        description:
          type: string
          description: Text describing the outage.
        category:
          type: string
          enum:
            - behavioural
            - adversarial
            - reachability
            - os
            - sporadic
          description: String indicating the category of outage
        duration:
          type: integer
          description: Sum total duration of all outages experienced with this `code` in
            the specified time range.
        distance:
          type: integer
          description: Sum total (estimated) distance covered during all outages
            experienced with this `code` in the specified time range.
      required:
        - category
        - code
        - description
        - distance
        - duration
        - label
    DriverSummaryStatus1:
      type: object
      properties:
        intended_to_track:
          type: boolean
          description: Boolean flag indicating whether worker was supposed to be tracked
            during the specified period.
        tracked:
          type: boolean
          description: Boolean flag indicating whether worker was actually tracked during
            the specified period.
        worked:
          type: boolean
          description: Boolean flag indicating whether worker had worked during the
            specified period.
        available:
          type: boolean
          description: Boolean flag indicating whether worker was marked available during
            the specified period.
      required:
        - available
        - intended_to_track
        - tracked
        - worked
    DriverSummary1:
      type: object
      properties:
        orders:
          description: Summary of orders fulfilled by the worker in the specified time
            range.
          allOf:
            - $ref: "#/components/schemas/OrderSummary1"
        geotags:
          type: integer
          nullable: true
          description: Number of Geotags created by the worker in the specified time range.
        visits:
          type: integer
          nullable: true
          description: Number of Visits made by the worker during the specified time range.
        intended_track_duration:
          type: integer
          description: Total duration (in seconds) for which the worker was supposed to be
            tracked during the specified time range.
        outage_duration:
          type: integer
          description: Total duration (in seconds) for which the worker could not be
            tracked (in outage) during the specified time range.
        outage_distance:
          type: integer
          description: Total estimated distance (in meters) covered by the worker while
            he/she could not be tracked during the specified time range.
        outage_summary:
          type: array
          description: List of outages experienced by the worker during the specified time
            range.
          items:
            $ref: "#/components/schemas/DriverOutageSummary1"
        tracked_duration:
          type: integer
          description: Total duration (in seconds) for which the worker was actually
            tracked during the specified time range.
        tracked_distance:
          type: integer
          description: Total distance (in meters) driven by the worker while the worker
            was actually tracked during the specified time range.
        avg_distance_per_visit:
          type: number
          description: Average distance (in meters) driven by the worker per visit while
            the worker was actually tracked during the specified time range.
        drive_duration:
          type: integer
          description: Total duration (seconds) for which the worker was driving during
            the specified time range.
        walk_duration:
          type: integer
          description: Total duration (seconds) for which the worker was walking during
            the specified time range.
        stop_duration:
          type: integer
          description: Total duration (seconds) for which the worker had stopped during
            the specified time range.
        order_duration:
          type: integer
          description: Total duration (seconds) which the worker had spent delivering
            orders.
        visit_duration:
          type: integer
          description: Total duration (seconds) which the worker had spent doing visits.
        geotag_duration:
          type: integer
          description: Total duration (seconds) which the worker had spent creating geotags.
        tracking_rate:
          type: number
          nullable: true
          description: Average tracking rate of the worker during the specified time range.
        stop_count:
          type: integer
          nullable: true
          description: Number of stops.
        walk_count:
          type: integer
          nullable: true
          description: Number of walks.
        drive_count:
          type: integer
          nullable: true
          description: Number of drives.
        distance:
          type: integer
          nullable: true
          description: Total distance (tracked + outage) in meters covered by the worker
            during the specified time range.
        available_duration:
          type: integer
          nullable: true
          description: "Total duration (in seconds) for which the worker was actually
            tracked during the specified time range.<br />__Please use the field
            `tracked_duration` instead.__  "
          deprecated: false
        work_duration:
          type: integer
          nullable: true
          description: Total duration (seconds) spent on work by the worker in the
            specified time range.
          deprecated: true
        disconnected_duration:
          type: integer
          nullable: true
          description: Total duration (in seconds) for which the worker was supposed to be
            tracked, but actually in a disconnected state.
          deprecated: false
        status:
          description: Flags indicating worker's work status during the specified time
            range.
          allOf:
            - $ref: "#/components/schemas/DriverSummaryStatus1"
      required:
        - avg_distance_per_visit
        - drive_duration
        - geotag_duration
        - intended_track_duration
        - order_duration
        - orders
        - outage_distance
        - outage_duration
        - outage_summary
        - status
        - stop_duration
        - tracked_distance
        - tracked_duration
        - visit_duration
        - walk_duration
    LocationPermission1:
      type: object
      properties:
        state:
          type: string
          enum:
            - always
            - foreground_only
            - never
            - location_imprecise
            - unknown
          description: State of location permission
        recorded_at:
          type: string
          nullable: true
          description: Time stamp of the last known location permission
      required:
        - state
    BatteryStatus1:
      type: object
      properties:
        battery_percent:
          type: integer
          description: Integer indicating the percent of charge on the battery.
        recorded_at:
          type: string
          description: Timestamp of the reading
      required:
        - battery_percent
        - recorded_at
    Worker:
      type: object
      properties:
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker
        name:
          type: string
          nullable: true
          description: Name of the worker
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group to which the worker belongs
        product_types:
          type: array
          description: List of product types used for worker matching during order planning
          items:
            type: string
        device_id:
          type: string
          nullable: true
          description: Unique ID representing the worker's device
        profile:
          type: object
          description: Metadata associated with a worker
          additionalProperties:
            nullable: true
        work_status:
          description: work_status of the worker with respect to availability and on order
            fulfilment
          allOf:
            - $ref: "#/components/schemas/DriverStatus1"
        schedule:
          type: array
          nullable: true
          description: List indicating the schedule of a worker for work assignment
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverDateSchedule"
              - $ref: "#/components/schemas/DriverRecurringSchedule"
        deleted:
          type: boolean
          nullable: true
          description: Flag indicating whether the worker was deleted
        created_at:
          type: string
          description: Timestamp at which the worker was created
        home:
          description: Worker home
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadiusResponse"
        deleted_at:
          type: string
          nullable: true
          description: Timestamp at which the worker was deleted
        location:
          nullable: true
          description: Last known location of the worker.
          allOf:
            - $ref: "#/components/schemas/MovementLocationResponse"
        device_status:
          nullable: true
          description: Current status of the device used by the worker
          allOf:
            - $ref: "#/components/schemas/DeviceStatus1"
        unavailable_on:
          type: array
          description: List of dates (YYYY-MM-DD) on which the worker is not available
          items:
            type: string
        summary:
          nullable: true
          description: Summary of work done by the worker during the specified time range.
            Default last 24 hours.
          allOf:
            - $ref: "#/components/schemas/DriverSummary1"
        location_permission:
          nullable: true
          description: Last known location permission on the worker's device
          allOf:
            - $ref: "#/components/schemas/LocationPermission1"
        device_info:
          nullable: true
          description: Information of the Device associated with Worker
          allOf:
            - $ref: "#/components/schemas/DeviceInfo"
        battery:
          nullable: true
          description: Information of the battery status.
          allOf:
            - $ref: "#/components/schemas/BatteryStatus1"
        timezone:
          type: string
          nullable: true
          description: Timezone of the worker
      required:
        - created_at
        - home
        - ops_group_handle
        - product_types
        - profile
        - unavailable_on
        - work_status
        - worker_handle
    WorkerAggregate:
      type: object
      properties:
        geotags:
          description: Aggregate information of geotags in the specified time range
          allOf:
            - $ref: "#/components/schemas/GeotagsAggregate"
        orders:
          description: Aggregate information of orders in the specified time range
          allOf:
            - $ref: "#/components/schemas/OrdersAggregate"
        workers:
          description: Aggregate information of workers in the specified time range
          allOf:
            - $ref: "#/components/schemas/DriversAggregate1"
        summary:
          description: Aggregate information of worker activities in the specified time
            range
          allOf:
            - $ref: "#/components/schemas/SummaryAggregate"
        tracking_rate:
          type: number
          nullable: true
          description: Tracking Rate
        outage_summary:
          type: array
          nullable: true
          description: Aggregate information of worker outage summaries in the specified
            time range
          items:
            $ref: "#/components/schemas/DriverOutageSummaryAggregate"
        location_permission_state_counts:
          description: Counts of location permission states for the last known device of
            workers.
          allOf:
            - $ref: "#/components/schemas/LocationPermissionStateCounts"
        visits:
          description: Aggregate information of visits in the specified time range
          allOf:
            - $ref: "#/components/schemas/VisitAggregateModel"
    GetWorkersResponse:
      type: object
      properties:
        workers:
          type: array
          nullable: true
          description: List of workers
          items:
            $ref: "#/components/schemas/Worker"
        pagination_token:
          type: string
          nullable: true
          description: Identifier used to fetch the next page of data
        aggregate:
          nullable: true
          description: Combined aggregate work metrics for workers in the given time
            range. Default last 24 hours.
          allOf:
            - $ref: "#/components/schemas/WorkerAggregate"
    PostWorkerRequest:
      type: object
      properties:
        profile:
          type: object
          nullable: true
          description: Additional customer provided data associated with a worker
          additionalProperties:
            nullable: true
        name:
          type: string
          nullable: true
          description: Name of the worker
        home:
          nullable: true
          description: Worker's home location
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadius1"
        product_types:
          type: array
          nullable: true
          description: List of product types used for worker matching during order planning
          items:
            type: string
        unavailable_on:
          type: array
          nullable: true
          description: List of dates (YYYY-MM-DD) on which the worker is unavailable
          items:
            type: string
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker
        device_id:
          type: string
          format: uuid
          nullable: true
          description: Unique ID representing the worker's device
        schedule:
          type: array
          nullable: true
          description: List of schedules used for worker matching during order planning
            and auto start/stop of availability or tracking of the worker
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverDateSchedule"
              - $ref: "#/components/schemas/DriverRecurringSchedule"
        ops_group_handle:
          type: string
          default: default
          nullable: true
          description: Unique identifier for an Ops Group to which the worker belongs
      required:
        - worker_handle
    PostWorkerResponse:
      type: object
      properties:
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker
        name:
          type: string
          nullable: true
          description: Name of the worker
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group to which the worker belongs
        product_types:
          type: array
          description: List of product types used for worker matching during order planning
          items:
            type: string
        device_id:
          type: string
          nullable: true
          description: Unique ID representing the worker's device
        profile:
          type: object
          description: Metadata associated with a worker
          additionalProperties:
            nullable: true
        work_status:
          description: work_status of the worker with respect to availability and on order
            fulfilment
          allOf:
            - $ref: "#/components/schemas/DriverStatus1"
        schedule:
          type: array
          nullable: true
          description: List indicating the schedule of a worker for work assignment
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverDateSchedule"
              - $ref: "#/components/schemas/DriverRecurringSchedule"
        deleted:
          type: boolean
          nullable: true
          description: Flag indicating whether the worker was deleted
        created_at:
          type: string
          description: Timestamp at which the worker was created
        home:
          description: Worker home
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadiusResponse"
        deleted_at:
          type: string
          nullable: true
          description: Timestamp at which the worker was deleted
        location:
          nullable: true
          description: Last known location of the worker.
          allOf:
            - $ref: "#/components/schemas/MovementLocationResponse"
        device_status:
          nullable: true
          description: Current status of the device used by the worker
          allOf:
            - $ref: "#/components/schemas/DeviceStatus1"
        unavailable_on:
          type: array
          description: List of dates (YYYY-MM-DD) on which the worker is not available
          items:
            type: string
        summary:
          nullable: true
          description: Summary of work done by the worker during the specified time range.
            Default last 24 hours.
          allOf:
            - $ref: "#/components/schemas/DriverSummary1"
        location_permission:
          nullable: true
          description: Last known location permission on the worker's device
          allOf:
            - $ref: "#/components/schemas/LocationPermission1"
        device_info:
          nullable: true
          description: Information of the Device associated with Worker
          allOf:
            - $ref: "#/components/schemas/DeviceInfo"
        battery:
          nullable: true
          description: Information of the battery status.
          allOf:
            - $ref: "#/components/schemas/BatteryStatus1"
        timezone:
          type: string
          nullable: true
          description: Timezone of the worker
      required:
        - created_at
        - home
        - ops_group_handle
        - product_types
        - profile
        - unavailable_on
        - work_status
        - worker_handle
    NearbyDestination:
      type: object
      properties:
        geometry:
          nullable: true
          description: Destination geometry, As of right now, only 'Point' is supported.
          allOf:
            - $ref: "#/components/schemas/LocationGeometry"
        place_handle:
          type: string
          nullable: true
          description: Optional place handle used to search nearby workers for. `geometry`
            will be derived from place handle and should not provided with this
            parameter.
    NearbyOrder:
      type: object
      properties:
        destination:
          nullable: true
          description: Destination location around which to search workers.
          allOf:
            - $ref: "#/components/schemas/NearbyDestination"
        order_handle:
          type: string
          nullable: true
          description: Optional order handle used to search nearby workers for, this can
            later be used for tracking and associate nearby requests with
            corresponding orders
        metadata:
          type: object
          nullable: true
          description: Optional order metadata.
          additionalProperties:
            nullable: true
    WorkStatus:
      type: object
      properties:
        tracking:
          type: boolean
          nullable: true
          description: Indicates if the worker is currently being tracked.
        available:
          type: boolean
          nullable: true
          description: Indicates if the worker is available for new tasks.
    SearchFilter:
      type: object
      properties:
        include_on_route:
          type: boolean
          nullable: true
          description: True when on route workers are also needed as part of response
            (default value is false).
        worker_profile:
          type: object
          nullable: true
          description: Used to specify a filter that is applied on the workers returned in
            a nearby search result; For example, this profile filter can
            represent attributes describing your gig workers, such as a team
            assignment, gig category, etc.
          additionalProperties:
            nullable: true
        worker_list:
          type: array
          nullable: true
          minItems: 1
          description: Array of worker handles whose estimates to order destination will
            be calculated. Only for search type 'eta', if present only
            `search_radius` filter is allowed, others are not allowed.
          items:
            type: string
        work_status:
          nullable: true
          description: Optional filter to specify the work status of workers to include in
            the search results.
          allOf:
            - $ref: "#/components/schemas/WorkStatus"
        search_radius:
          type: integer
          default: 160934
          nullable: true
          maximum: 160934
          description: Maximum distance (haversine) in meters of workers from order
            destination, maximum of 160934 meters (100 miles).
    NearbyRequest:
      type: object
      properties:
        ops_group_handle:
          type: string
          nullable: true
          description: ops group handle used to filter nearby search results by
            operational group
        order:
          $ref: "#/components/schemas/NearbyOrder"
        search_type:
          type: string
          enum:
            - eta
            - region
        search_filter:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/SearchFilter"
        limit:
          type: integer
          nullable: true
          maximum: 1000
      required:
        - order
        - search_type
    PointLocationGeometry:
      type: object
      properties:
        type:
          enum:
            - Point
          description: Point Geometry type
        coordinates:
          type: array
          description: Location coordinates represented as [longitude, latitude].
          items:
            type: number
      required:
        - coordinates
        - type
    NearbyOngoingRoute:
      type: object
      properties:
        route_handle:
          type: string
          description: route handle which is still ongoing (only present if worker has any
            ongoing route and request has include_on_route as true).
        destination:
          type: object
          description: Destination geometry for Ongoing route (only present if workers has
            any ongoing route and request has include_on_route as true).
          additionalProperties:
            nullable: true
        remaining_distance:
          type: integer
          description: Distance (in meters) workers needs to travel to reach route
            destination (only present if workers has any ongoing route and
            request has include_on_route as true).
        remaining_duration:
          type: integer
          description: Time (in seconds) needed for workers to travel to reach route
            destination (only present if workers has any ongoing route and
            request has include_on_route as true).
      required:
        - destination
        - remaining_distance
        - remaining_duration
        - route_handle
    NearbyWorkerSummary:
      type: object
      properties:
        device_id:
          type: string
          description: Device id of the worker.
        location:
          description: Location of the worker
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometry"
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for a worker
        name:
          type: string
          nullable: true
          description: Name of the worker
        profile:
          type: object
          nullable: true
          description: Metadata associated with a worker
          additionalProperties:
            nullable: true
        work_status:
          nullable: true
          description: work_status of the worker with respect to availability and on order
            fulfilment
          allOf:
            - $ref: "#/components/schemas/DriverStatus1"
        distance:
          type: number
          nullable: true
          description: Distance of the nearest location from the requested location in
            meters; null if no location was found. For eta search_type its the
            actual drive distance, for region search_type its the haversine
            distance.
        duration:
          type: number
          nullable: true
          description: Time needed to reach the nearest location in seconds; null if no
            location was found, only for eta search_type.
        ongoing_route:
          nullable: true
          description: Ongoing route summary (only present if workers has any ongoing
            route and request has `include_on_route` as true).
          allOf:
            - $ref: "#/components/schemas/NearbyOngoingRoute"
      required:
        - device_id
        - location
    NearbySummary:
      type: object
      properties:
        total_workers:
          type: integer
          description: Total number of workers found in nearby region matching the filters.
        processed_workers:
          type: integer
          description: Number of workers processed and returned in workers response.
        unprocessed_workers:
          type: integer
          description: Number of workers that have not been processed.
        outside_region_workers:
          type: integer
          description: Number of workers outside nearby region (default value of
            search_filter.search_radius), only returned if worker_list filter is
            specified.
        no_route_workers:
          type: integer
          description: Number of workers for whom no route was found to the destination,
            only returned if worker_list filter is specified.
      required:
        - no_route_workers
        - outside_region_workers
        - processed_workers
        - total_workers
        - unprocessed_workers
    NearbySearchRequestSummary:
      type: object
      properties:
        request_id:
          type: string
          description: Unique identifier for the nearby search request.
        request:
          description: Nearby search request.
          allOf:
            - $ref: "#/components/schemas/NearbyRequest"
        created_on:
          type: string
          description: Timestamp at which the nearby search request was created. This is
            in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ).
        workers:
          type: array
          nullable: true
          description: Nearby search response.
          items:
            $ref: "#/components/schemas/NearbyWorkerSummary"
        summary:
          nullable: true
          description: Summary of the nearby search results.
          allOf:
            - $ref: "#/components/schemas/NearbySummary"
        timezone:
          type: string
          nullable: true
          description: Timezone of the worker
      required:
        - created_on
        - request
        - request_id
    NearbyAggregates:
      type: object
      properties:
        total_requests:
          type: integer
          description: Total number of nearby search requests performed. This is only
            present when the request is made with aggregate=true.
        avg_workers_per_request:
          type: number
          description: Average number of workers returned per nearby search request. This
            is only present when the request is made with aggregate=true.
        unique_workers:
          type: integer
          description: Total number of unique workers returned across all nearby search
            requests. This is only present when the request is made with
            aggregate=true.
        request_with_workers:
          type: integer
          description: Total number of nearby search requests that returned at least one
            worker. This is only present when the request is made with
            aggregate=true.
      required:
        - avg_workers_per_request
        - request_with_workers
        - total_requests
        - unique_workers
    NearbySearchListResponse:
      type: object
      properties:
        requests:
          type: array
          description: List of nearby searches performed.
          items:
            $ref: "#/components/schemas/NearbySearchRequestSummary"
        pagination_token:
          type: string
          nullable: true
          description: Token to be used for pagination. If present, it indicates that
            there are more pages of results available.
        aggregates:
          nullable: true
          description: Aggregates for nearby search requests. This is only present when
            the request is made with aggregate=true.
          allOf:
            - $ref: "#/components/schemas/NearbyAggregates"
      required:
        - requests
    NearbyDeviceInfo:
      type: object
      properties:
        timezone:
          type: string
          nullable: true
          description: The timezone on the device in TZ format.
        os_name:
          type: string
          nullable: true
          description: The operating system of the device, can be one of iOS or Android.
        device_brand:
          type: string
          nullable: true
          description: The brand of the device.
        sdk_version:
          type: string
          nullable: true
          description: "The HyperTrack SDK version on the device. Can be reviewed here:
            Android, iOS, React Native."
        device_model:
          type: string
          nullable: true
          description: The device model.
        network_operator:
          type: string
          nullable: true
          description: The network operator for the device.
        os_version:
          type: string
          nullable: true
          description: The version of the operating system on the device.
        os_hardware_identifier:
          type: string
          nullable: true
          description: Hardware identifier returned from the OS. (OS specific. Android
            uses ANDROID_ID; iOS uses identifierForVendor.
        name:
          type: string
          nullable: true
          description: Name of the device.
    NearbyDeviceStatusData:
      type: object
      properties:
        recorded_at:
          type: string
          nullable: true
          description: ISO 8601 date when the device status was recorded.
        activity:
          type: string
          nullable: true
          description: Device activity (optional). If available, can be one of stop, walk,
            or drive.
        reason:
          type: string
          nullable: true
          description: "For inactive devices only. Can be one of:
            location_permissions_denied, location_services_disabled,
            motion_activity_permissions_denied,
            motion_activity_services_disabled,
            motion_activity_services_unavailable, tracking_stopped,
            tracking_service_terminated, uninstalled."
    NearbyDeviceStatus:
      type: object
      properties:
        value:
          type: string
          description: Can be one of active, inactive, disconnected, available or
            unavailable. Please read here to understand how HyperTrack tracks
            device status.
        data:
          description: Extra information about device status.
          allOf:
            - $ref: "#/components/schemas/NearbyDeviceStatusData"
      required:
        - data
        - value
    NearbyDevice:
      type: object
      properties:
        device_id:
          type: string
          description: Device id of the device.
        info:
          nullable: true
          description: device_info. Same fields support as in devices API.
          allOf:
            - $ref: "#/components/schemas/NearbyDeviceInfo"
        profile:
          type: object
          nullable: true
          description: Device metadata submitted via Mobile SDKs (Android, iOS) or Devices
            API.
          additionalProperties:
            nullable: true
        status:
          nullable: true
          description: Device status.
          allOf:
            - $ref: "#/components/schemas/NearbyDeviceStatus"
      required:
        - device_id
    NearbyWorker:
      type: object
      properties:
        device:
          description: Device related information of the worker.
          allOf:
            - $ref: "#/components/schemas/NearbyDevice"
        location:
          description: Location of the worker.
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometry"
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for a worker
        name:
          type: string
          nullable: true
          description: Name of the worker
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for an Ops Group to which the worker belongs
        product_types:
          type: array
          nullable: true
          description: List of product types used for worker matching during order planning
          items:
            type: string
        profile:
          type: object
          nullable: true
          description: Metadata associated with a worker
          additionalProperties:
            nullable: true
        work_status:
          nullable: true
          description: work_status of the worker with respect to availability and on order
            fulfilment
          allOf:
            - $ref: "#/components/schemas/DriverStatus1"
        schedule:
          type: array
          nullable: true
          description: List indicating the schedule of a worker for work assignment
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverDateSchedule"
              - $ref: "#/components/schemas/DriverRecurringSchedule"
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the worker was created
        home:
          nullable: true
          description: Worker home
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadiusResponse"
        unavailable_on:
          type: array
          nullable: true
          description: List of dates (YYYY-MM-DD) on which the worker is not available
          items:
            type: string
        location_permission:
          nullable: true
          description: Last known location permission on the worker's device
          allOf:
            - $ref: "#/components/schemas/LocationPermission1"
        battery:
          nullable: true
          description: Information of the battery status.
          allOf:
            - $ref: "#/components/schemas/BatteryStatus1"
        timezone:
          type: string
          nullable: true
          description: Timezone of the worker
        duration:
          type: number
          nullable: true
          description: Time needed to reach the nearest location in seconds; null if no
            location was found, only for eta search_type.
        distance:
          type: number
          nullable: true
          description: Distance of the nearest location from the requested location in
            meters; null if no location was found. For eta search_type its the
            actual drive distance, for region search_type its the haversine
            distance.
        ongoing_route:
          nullable: true
          description: Ongoing route summary (only present if workers has any ongoing
            route and request has include_on_route as true).
          allOf:
            - $ref: "#/components/schemas/NearbyOngoingRoute"
      required:
        - device
        - location
    NearbyResponse:
      type: object
      properties:
        request_id:
          type: string
          description: Unique identifier for the nearby request.
        workers:
          type: array
          description: List of worker objects.
          items:
            $ref: "#/components/schemas/NearbyWorker"
        summary:
          description: Summary of the nearby request.
          allOf:
            - $ref: "#/components/schemas/NearbySummary"
      required:
        - request_id
        - summary
        - workers
    Error:
      type: object
      properties:
        code:
          type: string
          description: error code for the type of error
        title:
          type: string
          description: error title
        detail:
          type: string
          description: error detail
    NearbyDestination1:
      type: object
      properties:
        geometry:
          description: Destination location around which to search drivers. As of right
            now, only 'Point' is supported.
          allOf:
            - $ref: "#/components/schemas/LocationGeometry"
      required:
        - geometry
    NearbyOrder1:
      type: object
      properties:
        destination:
          description: Destination location around which to search drivers. As of right
            now, only 'Point' is supported.
          allOf:
            - $ref: "#/components/schemas/NearbyDestination1"
        order_id:
          type: string
          nullable: true
          description: Optional order id used to search nearby drivers for.
        metadata:
          type: object
          nullable: true
          description: Optional order metadata.
          additionalProperties:
            nullable: true
      required:
        - destination
    SearchFilter1:
      type: object
      properties:
        search_radius:
          type: integer
          nullable: true
          maximum: 160934
          description: Maximum distance (haversine) in meters of drivers from order
            destination, maximum of 160934 meters (100 miles).
        include_on_trip:
          type: boolean
          nullable: true
          description: True when on trip drivers are also needed as part of response
            (default value is false).
        driver_profile:
          type: object
          nullable: true
          description: Used to specify a filter that is applied on the drivers returned in
            a nearby search result; For example, this profile filter can
            represent attributes describing your gig workers, such as a team
            assignment, gig category, etc.
          additionalProperties:
            nullable: true
        driver_list:
          type: array
          nullable: true
          minItems: 1
          description: Array of device ids whose estimates to order destination will be
            calculated. Only for search type 'eta', if present other filters are
            not allowed.
          items:
            type: string
            format: uuid
    NearbyRequest1:
      type: object
      properties:
        order:
          $ref: "#/components/schemas/NearbyOrder1"
        search_type:
          type: string
          enum:
            - eta
            - region
        search_filter:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/SearchFilter1"
        limit:
          type: integer
          nullable: true
          maximum: 1000
      required:
        - order
        - search_type
    NearbyDeviceInfo1:
      type: object
      properties:
        timezone:
          type: string
          description: The timezone on the device in TZ format.
        os_name:
          type: string
          description: The operating system of the device, can be one of iOS or Android.
        device_brand:
          type: string
          description: The brand of the device.
        sdk_version:
          type: string
          description: "The HyperTrack SDK version on the device. Can be reviewed here:
            Android, iOS, React Native."
        device_model:
          type: string
          description: The device model.
        network_operator:
          type: string
          description: The network operator for the device.
        os_version:
          type: string
          description: The version of the operating system on the device.
        os_hardware_identifier:
          type: string
          description: Hardware identifier returned from the OS. (OS specific. Android
            uses ANDROID_ID; iOS uses identifierForVendor.
        name:
          type: string
          description: Name of the device.
      required:
        - device_brand
        - device_model
        - name
        - network_operator
        - os_hardware_identifier
        - os_name
        - os_version
        - sdk_version
        - timezone
    NearbyDeviceStatusData1:
      type: object
      properties:
        recorded_at:
          type: string
          nullable: true
          description: ISO 8601 date when the device status was recorded.
        activity:
          type: string
          nullable: true
          description: Device activity (optional). If available, can be one of stop, walk,
            or drive.
        reason:
          type: string
          nullable: true
          description: "For inactive devices only. Can be one of:
            location_permissions_denied, location_services_disabled,
            motion_activity_permissions_denied,
            motion_activity_services_disabled,
            motion_activity_services_unavailable, tracking_stopped,
            tracking_service_terminated, uninstalled."
    NearbyDeviceStatus1:
      type: object
      properties:
        value:
          type: string
          description: Can be one of active, inactive, disconnected, available or
            unavailable. Please read here to understand how HyperTrack tracks
            device status.
        data:
          description: Extra information about device status.
          allOf:
            - $ref: "#/components/schemas/NearbyDeviceStatusData1"
      required:
        - data
        - value
    NearbyDevice1:
      type: object
      properties:
        device_id:
          type: string
          description: Device id of the device.
        info:
          description: device_info. Same fields support as in devices API.
          allOf:
            - $ref: "#/components/schemas/NearbyDeviceInfo1"
        profile:
          type: object
          description: Device metadata submitted via Mobile SDKs (Android, iOS) or Devices
            API.
          additionalProperties:
            nullable: true
        status:
          description: Device status.
          allOf:
            - $ref: "#/components/schemas/NearbyDeviceStatus1"
      required:
        - device_id
        - info
        - profile
        - status
    NearbyLocation:
      type: object
      properties:
        geometry:
          type: object
          description: Location geometry. As of right now, only Point is supported.
          additionalProperties:
            nullable: true
        type:
          type: string
          default: Point
      required:
        - geometry
    NearbyOngoingTrip:
      type: object
      properties:
        trip_id:
          type: string
          description: Trip id which is still ongoing (only present if device has any
            ongoing trip and request has include_on_trip as true).
        destination:
          type: object
          description: Destination geometry for Ongoing trip (only present if device has
            any ongoing trip and request has include_on_trip as true).
          additionalProperties:
            nullable: true
        remaining_distance:
          type: integer
          description: Distance (in meters) device needs to travel to reach trip
            destination (only present if device has any ongoing trip and request
            has include_on_trip as true).
        remaining_duration:
          type: integer
          description: Time (in seconds) needed for device to travel to reach trip
            destination (only present if device has any ongoing trip and request
            has include_on_trip as true).
      required:
        - destination
        - remaining_distance
        - remaining_duration
        - trip_id
    NearbyDriver:
      type: object
      properties:
        device:
          description: Device related information of the driver.
          allOf:
            - $ref: "#/components/schemas/NearbyDevice1"
        profile:
          type: object
          description: Device metadata submitted via Mobile SDKs (Android, iOS) or Devices
            API.
          additionalProperties:
            nullable: true
        status:
          description: Device status.
          allOf:
            - $ref: "#/components/schemas/NearbyDeviceStatus1"
        location:
          description: Location of the driver.
          allOf:
            - $ref: "#/components/schemas/NearbyLocation"
        duration:
          type: number
          nullable: true
          description: Time needed to reach the nearest location in seconds; null if no
            location was found, only for eta search_type.
        distance:
          type: number
          nullable: true
          description: Distance of the nearest location from the requested location in
            meters; null if no location was found. For eta search_type its the
            actual drive distance, for region search_type its the haversine
            distance.
        ongoing_trip:
          nullable: true
          description: Ongoing trip summary (only present if device has any ongoing trip
            and request has include_on_trip as true).
          allOf:
            - $ref: "#/components/schemas/NearbyOngoingTrip"
      required:
        - device
        - location
        - profile
        - status
    NearbySummary1:
      type: object
      properties:
        total_drivers:
          type: integer
          description: Total number of drivers found in nearby region matching the filters.
        processed_drivers:
          type: integer
          description: Number of drivers processed and returned in drivers response.
        unprocessed_drivers:
          type: integer
          description: Number of drivers that have not been processed.
        outside_region_drivers:
          type: integer
          description: Number of drivers outside nearby region (default value of
            search_filter.search_radius), only returned if driver_list filter is
            specified.
      required:
        - outside_region_drivers
        - processed_drivers
        - total_drivers
        - unprocessed_drivers
    NearbyResponse1:
      type: object
      properties:
        drivers:
          type: array
          description: List of driver objects.
          items:
            $ref: "#/components/schemas/NearbyDriver"
        summary:
          description: Summary of the nearby request.
          allOf:
            - $ref: "#/components/schemas/NearbySummary1"
      required:
        - drivers
        - summary
    CloseoutTimesheetBreak:
      type: object
      properties:
        start_time:
          type: string
          description: Break start time (ISO 8601)
        end_time:
          type: string
          description: Break end time (ISO 8601)
        duration:
          type: integer
          nullable: true
          description: Break duration in seconds
        type:
          type: string
          enum:
            - meal
            - rest
            - other
          nullable: true
          description: "Break category: meal, rest, other"
      required:
        - end_time
        - start_time
    CloseoutTimesheetEvent:
      type: object
      properties:
        start:
          type: string
          nullable: true
          description: Start time of the event (ISO 8601)
        duration:
          type: integer
          nullable: true
          description: Duration of the event in seconds
        type:
          type: string
          nullable: true
          description: Type of event
        data:
          type: object
          nullable: true
          description: Additional event data
          additionalProperties:
            nullable: true
    CloseoutTimesheet:
      type: object
      properties:
        type:
          type: string
          enum:
            - system
            - worker
            - requester
            - reconciled
          description: "Type of timesheet: system, worker, requester, reconciled"
        source:
          type: string
          default: api
          enum:
            - api
            - sms
            - email
            - phone
            - agent
          nullable: true
          description: "How this timesheet was obtained: api, sms, email, phone, agent.
            Defaults to 'api'."
        start_time:
          type: string
          nullable: true
          description: Start time (ISO 8601)
        end_time:
          type: string
          nullable: true
          description: End time (ISO 8601)
        total_duration_worked:
          type: integer
          nullable: true
          description: Total duration worked in seconds
        total_break_duration:
          type: integer
          nullable: true
          description: Total break duration in seconds
        total_payment_amount:
          type: number
          nullable: true
          description: Total payment amount
        approved_at:
          type: string
          nullable: true
          description: Timestamp when the timesheet was approved by the customer (ISO 8601)
        breaks:
          type: array
          nullable: true
          maxItems: 50
          description: Structured break records
          items:
            $ref: "#/components/schemas/CloseoutTimesheetBreak"
        events:
          type: array
          nullable: true
          description: List of timesheet events
          items:
            $ref: "#/components/schemas/CloseoutTimesheetEvent"
        raw:
          type: object
          nullable: true
          description: Raw timesheet data
          additionalProperties:
            nullable: true
      required:
        - type
    CloseoutWorkerLocation:
      type: object
      properties:
        geometry:
          description: GeoJSON Point geometry [longitude, latitude]
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometry"
        reported_at:
          type: string
          nullable: true
          description: When the location was reported (ISO 8601)
        inserted_at:
          type: string
          nullable: true
          description: When the location was inserted (ISO 8601)
        duration_at_location:
          type: integer
          nullable: true
          description: Duration at this location in seconds
      required:
        - geometry
    CloseoutMessage:
      type: object
      properties:
        timestamp:
          type: string
          nullable: true
          description: Message timestamp (ISO 8601)
        from:
          type: string
          nullable: true
          description: Sender of the message
        to:
          type: string
          nullable: true
          description: Recipient of the message
        type:
          type: string
          nullable: true
          description: Type of message
        phone_number:
          type: string
          nullable: true
          description: Phone number
        body:
          type: string
          nullable: true
          description: Message body
        duration:
          type: integer
          nullable: true
          description: Duration in seconds (for call-type messages)
    TrackOrder:
      type: object
      properties:
        order_handle:
          type: string
          minLength: 1
          description: Unique handle for Order
        destination:
          description: Object representing destination of the order
          oneOf:
            - $ref: "#/components/schemas/OrderListPolygonDestination"
            - $ref: "#/components/schemas/OrderListPointDestination"
            - $ref: "#/components/schemas/OrderListGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderListPlaceHandleDestination"
        scheduled_at:
          type: string
          nullable: true
          description: Schedule time by which order needs to be fulfilled. When this field
            is not provided, the ETA for the order is computed and the delay is
            relative to the first ETA.
        scheduled_after:
          type: string
          nullable: true
          description: Schedule time after which the worker needs to fulfill order
            (similar to slot start)
        expected_service_time:
          type: integer
          nullable: true
          description: Specified in seconds.
        metadata:
          type: object
          nullable: true
          description: Metadata for order
          additionalProperties:
            nullable: true
        product_type:
          type: array
          nullable: true
          description: Array of string representing skills required to fulfill the order
          items:
            type: string
        type:
          enum:
            - pick
            - drop
          nullable: true
          description: Type of Order
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric units which is to be occupied by the order
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order.
        type_index:
          type: integer
          nullable: true
          description: Volumetric units which is to be occupied by the order
        tasks_list:
          nullable: true
          description: List of task associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderTaskList"
        timesheets:
          type: array
          nullable: true
          maxItems: 20
          description: "[BETA] Timesheet data for closeout reconciliation. Only used when
            closeout_mode is 'standalone'."
          items:
            $ref: "#/components/schemas/CloseoutTimesheet"
        worker_locations:
          type: array
          nullable: true
          description: "[BETA] Worker location data for closeout reconciliation. Only used
            when closeout_mode is 'standalone'."
          items:
            $ref: "#/components/schemas/CloseoutWorkerLocation"
        messages:
          type: array
          nullable: true
          description: "[BETA] Messages data for closeout reconciliation. Only used when
            closeout_mode is 'standalone'."
          items:
            $ref: "#/components/schemas/CloseoutMessage"
        facility_name:
          type: string
          nullable: true
          description: "[BETA] Facility name for closeout reconciliation. Only used when
            closeout_mode is 'standalone'."
        workflow_ids:
          type: array
          nullable: true
          description: "[BETA] Workflow IDs for closeout reconciliation. Only used when
            closeout_mode is 'standalone' or 'tracked'."
          items:
            type: string
      required:
        - destination
        - order_handle
    TrackOrderRoute:
      type: object
      properties:
        route_handle:
          type: string
          nullable: true
          description: route handle for the route to be created
        metadata:
          type: object
          nullable: true
          description: Metadata for the route
          additionalProperties:
            nullable: true
    TrackOrdersRequest:
      type: object
      properties:
        route_handle:
          type: string
          nullable: true
          description: Unique Handle of route to be tracked. if provided other parameters
            are not required and will be ignored if provided
        driver_handle:
          type: string
          nullable: true
          description: One of device_id or driver handle is mandatory
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: One of device_id or worker handle is mandatory
        ops_group_handle:
          type: string
          nullable: true
          description: Unique Handle of Ops Group for which orders are to be tracked
        device_id:
          type: string
          nullable: true
          description: One of device_id or driver handle is mandatory
        orders:
          type: array
          nullable: true
          description: List of Orders which are to be tracked. Required if route handle is
            not provided, i.e. new route will be created
          items:
            $ref: "#/components/schemas/TrackOrder"
        track_mode:
          enum:
            - full_shift
            - pre_shift
            - on_shift
            - on_time
            - flex
          description: Tracking mode of the order. Note that `on_time` and `flex` are
            deprecated modes.
        route:
          nullable: true
          description: Route that will be created to contain the orders to be tracked
          allOf:
            - $ref: "#/components/schemas/TrackOrderRoute"
        version:
          type: integer
          nullable: true
          description: Route version.
        agent_mode:
          enum:
            - standalone
            - tracked
            - off
          nullable: true
          description: "[BETA] Agent reconciliation mode. 'standalone' runs reconciliation
            based on data provided without HyperTrack tracking. 'tracked'
            enables normal HyperTrack tracking and forwards order data to
            Closeout Copilot asynchronously for reconciliation."
        closeout_mode:
          enum:
            - standalone
            - tracked
            - off
          writeOnly: true
          nullable: true
          description: "[BETA] Deprecated alias for agent_mode. Use agent_mode instead."
        worker_phone_number:
          type: string
          nullable: true
          description: "[BETA] Worker phone number for closeout reconciliation. Only used
            when closeout_mode is 'standalone'."
        device_switch_mode:
          default: login
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: >-
            Mode to control the active device for tracking orders. The following
            options are available: 
             - `login` : Order tracking is based on the device the worker last logged into. When the worker logs into a new device, the orders automatically transfer to the new device. This is the default setting.
            - `closest_to_destination` : Order tracking is based on the device
            closest to the order's destination. The system monitors all of the
            worker's recent devices and selects the one nearest to the
            destination for tracking the order.

            - `manual` : Order tracking remains on the device that was active
            when the order was created.
      required:
        - track_mode
    TrackedOrder:
      type: object
      properties:
        timezone:
          type: string
          nullable: true
          description: Time zone
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          enum:
            - planned
            - assigned
            - dispatched
            - ongoing
            - disabled
            - cancelled
            - completed
            - summarizing
            - unplanned
          description: Current state of the order - `unplanned`, `planned`, `assigned`,
            `ongoing`, `completed`, `cancelled`
        destination:
          description: Destination for the order
          allOf:
            - $ref: "#/components/schemas/OrderDestinationSpecialType"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the orders in the
            route are associated
        plan_mode:
          enum:
            - on_demand
            - scheduled
            - pool
            - manual
          nullable: true
          description: Value indicating how the order was planned - `on_demand`, `manual`,
            `scheduled`
        plan_id:
          type: string
          nullable: true
          description: Order plans identifier
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        driver_name:
          type: string
          nullable: true
          description: Customer provided name for the driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            nullable: true
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify the index of type
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderListEstimate"
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        track_mode:
          enum:
            - on_time
            - flex
            - on_shift
            - pre_shift
            - full_shift
          nullable: true
          description: Value representing whether the order is tracked in on_shift,
            pre_shift or full_shift mode. Modes such as `on_time` and `flex` are
            deprecated.
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver was tracked at the location when
            fulfilling the order
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after order start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after order
            start
        created_by:
          nullable: true
          description: Source of the order creation. This can be a user, system, or any
            other entity responsible for creating the order.
          allOf:
            - $ref: "#/components/schemas/Source"
        outage_summary:
          type: array
          nullable: true
          description: List of outages experienced during the specified time range.
          items:
            $ref: "#/components/schemas/OrderOutageSummary"
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Order is expected to switch device
        tasks:
          type: array
          nullable: true
          description: List of tasks associated with the order.
          items:
            $ref: "#/components/schemas/OrderTask"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order.
        worker_profile:
          type: object
          nullable: true
          description: Metadata associated with a driver
          additionalProperties:
            nullable: true
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
      required:
        - destination
        - order_handle
        - status
    TrackOrdersResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/TrackedOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          description: Value representing whether the order is tracked in on_shift,
            pre_shift or full_shift mode. Modes such as `on_time` and `flex` are
            deprecated.
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after order start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after order
            start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - assigned_at
        - created_at
        - embed_url
        - orders
        - route_handle
        - started_at
        - status
        - track_mode
        - version
    PlanListRoute:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
      required:
        - route_handle
        - status
    OrderObjectMini:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        type:
          type: string
          description: Type of order
        type_index:
          type: integer
          description: Index to help distinguish similar handle and type orders
        plan_mode:
          type: string
          nullable: true
          description: Mode with which the order was planned
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
      required:
        - order_handle
        - status
        - type
        - type_index
    PlanSummaryOrders:
      type: object
      properties:
        total:
          type: integer
          description: Total number of orders under consideration for planning
        planned:
          type: integer
          description: Total number of orders successfully planned
        unplanned:
          type: integer
          description: Total number of orders which could not be planned
        assigned:
          type: integer
          description: Total number of orders which were successfully assigned to any driver
        completed:
          type: integer
          description: Total number of orders which have been completed
        cancelled:
          type: integer
          description: Total number of orders which have been cancelled
      required:
        - assigned
        - cancelled
        - completed
        - planned
        - total
        - unplanned
    PlanSummaryEstimate:
      type: object
      properties:
        distance:
          type: integer
          description: Total distance estimated to be travelled.
        duration:
          type: integer
          description: Total duration estimated to be travelled.
      required:
        - distance
        - duration
    PlanSummary:
      type: object
      properties:
        orders:
          description: Distribution of orders part of plan
          allOf:
            - $ref: "#/components/schemas/PlanSummaryOrders"
        estimate:
          description: Estimated distance and duration for the planned orders
          allOf:
            - $ref: "#/components/schemas/PlanSummaryEstimate"
        distance:
          type: integer
          description: Total distance travelled for completed and cancelled orders
        duration:
          type: integer
          description: Total duration travelled for completed and cancelled orders
        routes:
          type: integer
          description: Total number of routes planned.
        drivers:
          type: integer
          description: Total number of drivers assigned
      required:
        - distance
        - drivers
        - duration
        - estimate
        - orders
        - routes
    PlanListResponse:
      type: object
      properties:
        plan_id:
          type: string
          description: Unique ID of the plan.
        sequence_number:
          type: integer
          description: Sequence number of the latest planning run.
        routes:
          type: array
          description: List of routes planned as part of this plan.
          items:
            $ref: "#/components/schemas/PlanListRoute"
        unplanned_orders:
          type: array
          description: List of orders which has not been planned.
          items:
            $ref: "#/components/schemas/OrderObjectMini"
        status:
          type: string
          enum:
            - failed
            - completed
            - planning
          description: Status of the plan based on the latest planning run.
        started_at:
          type: string
          description: Timestamp representing the start time of latest planning run for
            the plan.
        created_at:
          type: string
          description: Timestamp representing the creation time of the plan.
        ops_group_handle:
          type: string
          description: Unique Handle of ops group handle of the plan.
        fulfillment_date:
          type: string
          description: Date (YYYY-MM-DD) representing the fulfillment date of plan.
        failure_reason:
          type: string
          description: Reason of failure of the latest planning run for plan. Sample
            values are listed below.</br><ul><li> Ops group location cannot be
            the same as an order location</li> <li>Could not resolve country
            when planning orders</li> <li>Could not resolve ISO3 country_code
            for country</li> <li>Route planning is currently not enabled for
            country</li></ul>
        summary:
          description: Summary of the plan
          allOf:
            - $ref: "#/components/schemas/PlanSummary"
      required:
        - created_at
        - fulfillment_date
        - ops_group_handle
        - plan_id
        - sequence_number
        - started_at
        - status
        - summary
    GetPlansResponse:
      type: object
      properties:
        plans:
          type: array
          description: List of plan objects
          items:
            $ref: "#/components/schemas/PlanListResponse"
        pagination_token:
          type: string
          description: Token representing the pointer to the last object in current page,
            in case more pages are present
      required:
        - pagination_token
        - plans
    OrderExportRequest:
      type: object
      properties:
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the worker to used retrieve
            orders associated with the specified worker
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place to be used
            retrieve orders associated with the specified place
        search_term:
          type: string
          nullable: true
          description: String representing the search term. Search will be done on
            order_handle, ops_group_handle, worker_handle and metadata fields.
        ops_group_handle:
          type: string
          nullable: true
          description: Unique Handle of Ops Group to fetch orders for
        order_metadata_filter:
          type: string
          nullable: true
          description: JSON encoded string for order metadata to filter orders by
        risk_status:
          type: string
          nullable: true
          description: Filter for risk status of order
        region_filter:
          type: string
          nullable: true
          description: JSON object containing `city`, `state`, or `country` used to filter
            orders
        status:
          type: string
          nullable: true
          description: String representation of Order status to fetch orders for. It can
            be comma separated list, each item in list can be one of
            `completed`, `cancelled`, `rescheduled`, `disabled`, `ongoing`,
            `unplanned`, `assigned`, `planned`. eg.
            `?status=completed,cancelled` or `?status=completed` to filter for
            one status
        device_id:
          type: string
          nullable: true
          description: Filter for orders associated with this device id.
        destination_geohash:
          type: string
          nullable: true
          description: Geohash of the area where order destination must lie.
        plan_mode:
          enum:
            - on_demand
            - scheduled
            - manual
            - pool
          nullable: true
          description: Mode of planning to be used to filter orders
        plan_id:
          type: string
          nullable: true
          description: Filter for orders in this plan id.
        route_handle:
          type: string
          nullable: true
          description: Unique Handle of the route to fetch orders for
        track_mode:
          enum:
            - on_time
            - flex
            - pre_shift
            - on_shift
            - full_shift
          nullable: true
          description: Tracking mode to filter orders by. See
            [pre_shift](https://hypertrack.com/docs/shift-tracking#pre-shift-tracking),
            [on_shift](https://hypertrack.com/docs/shift-tracking#on-shift-tracking)
            documentation. `full_shift` includes both pre-shift and on-shift
            tracking. Note that `on_time` and `flex` are deprecated modes.
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Device switch mode to filter orders by.
        created_at_date:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            created on a given date.
        created_at_from:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders that created within a timeframe.
        created_at_to:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that created within a timeframe.
        planned_at_date:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            planned on a given date.
        planned_at_from:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders planned within a timeframe.
        planned_at_to:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders planned within a timeframe.
        scheduled_at_date:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            scheduled on a given date.
        scheduled_at_date_without_tz:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            scheduled on a given date irrespective of timezone.
        completed_at_date_without_tz:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            completed on a given date irrespective of timezone.
        scheduled_at_from:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders which have scheduled_at within a timeframe.
        scheduled_at_to:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that which have scheduled_at within a timeframe.
        scheduled_at_without_tz_from:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders of that day in all timezone.
        scheduled_at_without_tz_to:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders of that day in all timezone.
        cancelled_at_date:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            cancelled on a given date.
        cancelled_at_from:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders that cancelled within a timeframe.
        cancelled_at_to:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that cancelled within a timeframe.
        completed_at_date:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            completed on a given date.
        completed_at_from:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders that completed within a timeframe.
        completed_at_to:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that completed within a timeframe.
        rescheduled_marked_at_date:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            rescheduled on a given date.
        rescheduled_marked_at_from:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders that rescheduled within a timeframe.
        rescheduled_marked_at_to:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders that rescheduled within a timeframe.
        route_started_at_date:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders for which
            route started on a given date.
        route_started_at_from:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders for which route started within a timeframe.
        route_started_at_to:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders for which route started within a timeframe.
        completed_at_without_tz_from:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the start of window to retrieve
            orders of that day for all timezone for completed orders.
        completed_at_without_tz_to:
          type: string
          nullable: true
          description: Timestamp (YYYY-MM-DD HH:mm:ss) of the end of window to retrieve
            orders of that day for all timezone for completed orders.
        created_at_without_tz_from:
          type: string
          nullable: true
          description: Start Date (YYYY-MM-DD ) of the window to retrieve orders from that
            day for all timezone for created orders.
        created_at_without_tz_to:
          type: string
          nullable: true
          description: End Date (YYYY-MM-DD ) of the window to retrieve orders till that
            day for all timezone for created orders.
        created_at_date_without_tz:
          type: string
          nullable: true
          description: Date (YYYY-MM-DD) used as a filter to retrieve orders that are
            created on a given date irrespective of timezone.
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the driver to used retrieve
            orders associated with the specified driver
          deprecated: true
        sort_direction:
          enum:
            - desc
            - asc
          nullable: true
          description: String indicating the preferred sorting type
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Filter for fulfillment attempt number
        aggregate:
          type: boolean
          nullable: true
          description: Flag to fetch order's aggregated data.
        limit:
          type: integer
          nullable: true
          description: Limit to number of results in response
        pagination_token:
          type: string
          nullable: true
          description: Encoded value provided by our API to retrieve the next page of orders
        send_outage:
          type: boolean
          nullable: true
          description: Boolean to send the outage in aggregation
        tracking_status:
          type: string
          enum:
            - tracked
            - untracked
          nullable: true
          description: Parameter to filter for tracked and untracked orders
        filter_outage_category:
          type: string
          nullable: true
          description: List of outage category as comma separated strings used for
            filtering associated orders within time range
        worker_profile_filter:
          type: string
          nullable: true
          format: Encoded JSON
          description: JSON encoded string metadata associated with the worker to filter
            orders
        worker_inside_destination:
          type: boolean
          nullable: true
          description: Boolean flag to filter orders based on whether the worker is inside
            the destination or not.
        email_recipients:
          type: array
          description: Optional list of email addresses to send the export download link.
            Falls back to the account email when omitted.
          items:
            type: string
    OrderExportResponse:
      type: object
      properties:
        job_id:
          type: string
          description: Unique identifier for the export job
        status:
          type: string
          description: "Current status of the export job: pending, processing, completed,
            failed"
        message:
          type: string
          description: Human-readable message about the job
      required:
        - job_id
        - message
        - status
    RouteListOrder:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        type:
          type: string
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify if the order is a pick/drop
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        expected_service_time:
          type: string
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderListEstimate"
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver was tracked at the location when
            fulfilling the order
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
      required:
        - order_handle
        - status
    RouteListEstimate:
      type: object
      properties:
        start_by:
          type: string
          nullable: true
          description: "Estimated timestamp by which a driver should start travelling to
            fulfill all route orders on time "
        distance:
          type: integer
          description: Estimated total distance that the driver should travel in the route
        duration:
          type: integer
          description: Estimated total time that the driver should spend to fulfill all
            orders in the route
      required:
        - distance
        - duration
    RouteList:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteListOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteListEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
      required:
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    GetRoutesResponse:
      type: object
      properties:
        routes:
          type: array
          description: ""
          items:
            $ref: "#/components/schemas/RouteList"
        pagination_token:
          type: string
          description: ""
      required:
        - pagination_token
        - routes
    OrderHandleInput:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        type:
          type: string
          enum:
            - drop
            - pick
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Index value of order of the same type and order handle
      required:
        - order_handle
    CreateManualRouteRequest:
      type: object
      properties:
        orders:
          type: array
          minItems: 1
          description: List of unplanned orders to be added to the route
          items:
            $ref: "#/components/schemas/OrderHandleInput"
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Filter routes on the specified track_mode
        ops_group_handle:
          type: string
          nullable: true
          description: Filter routes on the specified ops group
        optimise:
          type: boolean
          nullable: true
          description: Flag to determine whether orders sequence needs to be updated to
            minimise total travel distance.
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver to whom the
            route needs to be assigned to
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker to whom the
            route needs to be assigned to
      required:
        - orders
    CreateManualRouteResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          description: Value would be `manual`
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - created_at
        - embed_url
        - orders
        - plan_mode
        - route_handle
        - status
        - version
    LocateDeviceResultResponse:
      type: object
      properties:
        device_id:
          type: string
          description: Unique ID representing the device that was located.
        status:
          type: string
          enum:
            - pending
            - completed
            - error
          description: "Per-device locate status: `pending` while async work is in flight,
            `completed` once the async work for this device is done (inspect
            `location` / `outage_reasons` / `device_status` for the outcome),
            `error` on unexpected processing failure."
        location:
          nullable: true
          description: Location pulled from this device, if any.
          allOf:
            - $ref: "#/components/schemas/MovementLocationResponse"
        location_permission:
          nullable: true
          description: Last known location permission for this device.
          allOf:
            - $ref: "#/components/schemas/LocationPermission1"
        device_status:
          nullable: true
          description: Connection-level outcome for this locate attempt. Populated when
            the SDK didn't come back online within the wake-and-wait budget
            (`value` = `disconnected`). Same shape as `worker.device_status`.
          allOf:
            - $ref: "#/components/schemas/DeviceStatus"
        outage_reasons:
          type: array
          nullable: true
          description: Outage details reported by the SDK; same shape as
            `worker.summary.outages`.
          items:
            $ref: "#/components/schemas/DriverOutageSummary"
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which this device's locate reached terminal state.
      required:
        - device_id
        - status
    LocateResponse:
      type: object
      properties:
        request_id:
          type: string
          description: Unique identifier for the locate request.
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker.
        status:
          type: string
          enum:
            - pending
            - completed
            - error
          description: "Worker-level rollup: `pending` while async work is in flight,
            `completed` once the async work is done (introspect `devices[]` for
            per-device outcomes — connection state lives on `device_status`,
            outage detail on `outage_reasons`), `error` on unexpected internal
            failure."
        devices:
          type: array
          nullable: true
          description: Per-device locate results, newest session first. Empty array when
            the worker has no active device sessions; see each entry's
            `outage_reasons` for per-device outages.
          items:
            $ref: "#/components/schemas/LocateDeviceResultResponse"
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the locate request was created.
        updated_at:
          type: string
          nullable: true
          description: Timestamp of last update to the locate request.
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the locate request reached a terminal state.
      required:
        - request_id
        - status
        - worker_handle
    WorkerExportRequest:
      type: object
      properties:
        from_date:
          type: string
          nullable: true
          description: "ISO 8601 date format ('yyyy-MM-dd') indicating the start date to
            be used for the summary computation.<br>Default: Current date in
            UTC."
        to_date:
          type: string
          nullable: true
          description: "ISO 8601 date format ('yyyy-MM-dd') indicating the end date to be
            used for the summary computation.<br>Default: Current date in UTC."
        limit:
          type: integer
          default: 25
          nullable: true
          description: Number of workers to be sent in response
        include_schedule:
          type: boolean
          default: true
          description: Flag to include worker's schedule in the response.
        include_summary:
          type: boolean
          default: true
          description: Flag to include worker's summary stats in the response.
        ops_group_handle:
          type: string
          nullable: true
          description: List of ops group handles as comma separated strings used to filter
            workers.
        profile:
          type: string
          nullable: true
          description: Profile filter to be applied on the list of workers
        worker_handle:
          type: string
          nullable: true
          description: List of worker handles as comma separated strings used for fetching
            associated workers
        search_term:
          type: string
          nullable: true
          description: Keyword to match against worker handle, name, or profile
        pagination_token:
          type: string
          nullable: true
          description: Identifier used to fetch the next page of data
        device_id:
          type: string
          format: uuid
          nullable: true
          description: Unique identifier for a worker's device. This field is present in
            case the worker is currently linked with a device
        include_deleted:
          type: boolean
          default: false
          description: Flag to include deleted workers
        from_time:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 datetime indicating the start time to be used for
            computing summary, status.
          deprecated: true
        to_time:
          type: string
          format: date-time
          nullable: true
          description: ISO 8601 datetime indicating the end time to be used for computing
            summary, status.
          deprecated: true
        filter_outage:
          type: string
          nullable: true
          description: Filter workers on a particular outage code.
        filter_outage_category:
          type: string
          nullable: true
          description: "List of comma separated outage categories to be used for filtering
            workers. Valid categories:
            `behavioural`,`adversarial`,`reachability`,`os`,`sporadic`"
        filter_geofence_metadata:
          type: string
          nullable: true
          description: geofence_metadata filter for aggregate response
        aggregate:
          type: boolean
          default: false
          description: Flag set to retrieve aggregated data over the provided time range
        work_status:
          type: string
          nullable: true
          description: URL-encoded json string specifying filters on availability or
            tracking.
        filter_status:
          type: string
          enum:
            - active
            - inactive
            - disconnected
          nullable: true
          description: Only list workers that are currently active/inactive/disconnected.
        tracked:
          type: boolean
          nullable: true
          description: If set to true, only shows workers that were actually tracked
            during the specified period.
        worked:
          type: boolean
          nullable: true
          description: If set to true, only shows workers that actually during the
            specified period.
        intended_to_track:
          type: boolean
          nullable: true
          description: If set to true, only shows workers that was supposed to be tracked
            during the specified period.
        include_lp:
          type: boolean
          default: false
          nullable: true
          description: Flag to include location permission stats in response (only
            applicable when `aggregate=True`).
        region_filter:
          type: string
          nullable: true
          description: URL-encoded JSON string used to filter workers from a particular
            region. Ex `{"city":"Detroit"}`
        email_recipients:
          type: array
          description: Optional list of email addresses to send the export download link.
            Falls back to the account email when omitted.
          items:
            type: string
    WorkerExportResponse:
      type: object
      properties:
        job_id:
          type: string
          description: Unique identifier for the export job
        status:
          type: string
          description: "Current status of the export job: pending, processing, completed,
            failed"
        message:
          type: string
          description: Human-readable message about the job
      required:
        - job_id
        - message
        - status
    Order:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          enum:
            - planned
            - assigned
            - dispatched
            - ongoing
            - disabled
            - cancelled
            - completed
            - summarizing
            - unplanned
          description: Current state of the order - `unplanned`, `planned`, `assigned`,
            `ongoing`, `completed`, `cancelled`
        destination:
          description: Destination for the order
          allOf:
            - $ref: "#/components/schemas/OrderDestinationSpecialType"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the orders in the
            route are associated
        plan_mode:
          enum:
            - on_demand
            - scheduled
            - pool
            - manual
          nullable: true
          description: Value indicating how the order was planned - `on_demand`, `manual`,
            `scheduled`
        plan_id:
          type: string
          nullable: true
          description: Order plans identifier
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        driver_name:
          type: string
          nullable: true
          description: Customer provided name for the driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            nullable: true
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify the index of type
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderListEstimate"
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        track_mode:
          enum:
            - on_time
            - flex
            - on_shift
            - pre_shift
            - full_shift
          nullable: true
          description: Value representing whether the order is tracked in on_shift,
            pre_shift or full_shift mode. Modes such as `on_time` and `flex` are
            deprecated.
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver was tracked at the location when
            fulfilling the order
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after order start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after order
            start
        created_by:
          nullable: true
          description: Source of the order creation. This can be a user, system, or any
            other entity responsible for creating the order.
          allOf:
            - $ref: "#/components/schemas/Source"
        outage_summary:
          type: array
          nullable: true
          description: List of outages experienced during the specified time range.
          items:
            $ref: "#/components/schemas/OrderOutageSummary"
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Order is expected to switch device
        tasks:
          type: array
          nullable: true
          description: List of tasks associated with the order.
          items:
            $ref: "#/components/schemas/OrderTask"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order.
        worker_profile:
          type: object
          nullable: true
          description: Metadata associated with a driver
          additionalProperties:
            nullable: true
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
      required:
        - destination
        - order_handle
        - status
    EstimateRouteResponse:
      type: object
      properties:
        estimate:
          description: Object containing the estimate information for the sequence of
            orders to estimate
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        orders:
          type: array
          description: List of orders with which the estimate was being called for
          items:
            $ref: "#/components/schemas/Order"
      required:
        - estimate
        - orders
    VisitLocationInfo:
      type: object
      properties:
        location:
          nullable: true
          description: Location for this visit
          allOf:
            - $ref: "#/components/schemas/LocationGeometry"
        recorded_at:
          type: string
          format: date-time
          description: Recorded timestamp of visit
        location_accuracy:
          type: number
          nullable: true
          description: Location accuracy in meters
      required:
        - recorded_at
    EnrouteStatsInfo1:
      type: object
      properties:
        duration:
          type: integer
          nullable: true
          description: Duration to be tracked for the visit
        distance:
          type: integer
          nullable: true
          description: Distance to be tracked for the visit
        idle_time:
          type: integer
          nullable: true
          description: Idle time to be tracked for the visit
        outage_duration:
          type: integer
          nullable: true
          description: Outage duration for the visit
        outage_distance:
          type: integer
          nullable: true
          description: Outage distance for the visit
        outage:
          type: object
          nullable: true
          description: Outage summary for the visit
          additionalProperties:
            nullable: true
    ServiceStatsInfo1:
      type: object
      properties:
        duration:
          type: integer
          nullable: true
          description: Duration to be tracked for the visit
        distance:
          type: integer
          nullable: true
          description: Distance to be tracked for the visit
        outage_duration:
          type: integer
          nullable: true
          description: Outage duration for the visit
        outage:
          type: object
          nullable: true
          description: Outage summary for the visit
          additionalProperties:
            nullable: true
    PatchVisitRequest:
      type: object
      properties:
        visit_id:
          type: string
          format: uuid
          nullable: true
          description: Unique identifier representing each visit.
        updated_at:
          type: string
          format: date-time
          nullable: true
          description: Updated timestamp of the visit
        geofence_id:
          type: string
          format: uuid
          nullable: true
          description: GeofenceId associated with the visit
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: Driver handle for this visit
        worker_handle:
          type: string
          nullable: true
          description: Worker handle for this visit
        worker_name:
          type: string
          nullable: true
          description: Worker name for this visit
        worker_profile:
          type: object
          nullable: true
          description: Worker profile associated with visit.
          additionalProperties:
            nullable: true
        order_handle:
          type: string
          nullable: true
          description: Order handle for this visit
        place_handle:
          type: string
          nullable: true
          description: Place handle for this visit
        arrival:
          nullable: true
          description: Arrival info of this visit
          allOf:
            - $ref: "#/components/schemas/VisitLocationInfo"
        exit:
          nullable: true
          description: Exit info of this visit
          allOf:
            - $ref: "#/components/schemas/VisitLocationInfo"
        enroute:
          nullable: true
          description: Stats for the given visit for enroute
          allOf:
            - $ref: "#/components/schemas/EnrouteStatsInfo1"
        service:
          nullable: true
          description: Stats for given visit during service
          allOf:
            - $ref: "#/components/schemas/ServiceStatsInfo1"
        metadata:
          type: object
          nullable: true
          description: Metadata associated with visit.
          additionalProperties:
            nullable: true
        geofence_type:
          type: string
          nullable: true
          description: Geofence type for this visit
        region:
          type: object
          nullable: true
          description: Region associated with visit.
          additionalProperties:
            nullable: true
        system_generated_order_handle:
          type: boolean
          nullable: true
          description: Boolean to filter out orders where order handle was automatically
            generated by HT system
    PatchVisitResponse:
      type: object
      properties:
        visit_id:
          type: string
          format: uuid
          description: Unique identifier representing each visit.
        created_at:
          type: string
          description: Creation timestamp of visit
        updated_at:
          type: string
          nullable: true
          description: Last Updated timestamp of visit
        geofence_id:
          type: string
          format: uuid
          description: GeofenceId associated with visit
        driver_handle:
          type: string
          deprecated: true
          description: Driver handle for this visit
        worker_handle:
          type: string
          description: Worker handle for this visit
        worker_name:
          type: string
          nullable: true
          description: Worker name for this visit
        worker_profile:
          type: object
          nullable: true
          description: Worker profile associated with visit.
          additionalProperties:
            nullable: true
        device_id:
          type: string
          format: uuid
          nullable: true
          description: Device id associated with visit
        order_handle:
          type: string
          description: Order handle for this visit
        place_handle:
          type: string
          nullable: true
          description: Place handle for this visit
        ops_group_handle:
          type: string
          description: Ops Group handle for this visit
        arrival:
          nullable: true
          description: Arrival information of visit
          allOf:
            - $ref: "#/components/schemas/LocationInfo"
        exit:
          nullable: true
          description: Exited information of visit
          allOf:
            - $ref: "#/components/schemas/LocationInfo"
        enroute:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/EnrouteStatsInfo"
        service:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/ServiceStatsInfo"
        metadata:
          type: object
          nullable: true
          description: Metadata associated with this visit.
          additionalProperties:
            nullable: true
        geofence_metadata:
          type: object
          nullable: true
          description: Geofence Metadata associated with the visit.
          additionalProperties:
            nullable: true
        tracking_rate:
          type: number
          description: Driver tracking rate during the lifespan of the order
        system_generated_order_handle:
          type: boolean
          nullable: true
          description: Boolean to filter out orders where order handle was automatically
            generated by HT system
        visit_geometry:
          nullable: true
          description: Geometry of the visit
          allOf:
            - $ref: "#/components/schemas/VisitGeometryModel"
        geofence_address:
          type: string
          nullable: true
          description: Geofence address for this visit
        timezone:
          type: string
          nullable: true
          description: Timezone associated with this visit
        attachments:
          type: array
          nullable: true
          description: Attachments associated with this geotag
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
      required:
        - created_at
        - geofence_id
        - ops_group_handle
        - order_handle
        - visit_id
    OpsGroupHome:
      type: object
      properties:
        geometry:
          description: Location of the Ops Group home
          allOf:
            - $ref: "#/components/schemas/LocationGeometry"
        address:
          type: string
          nullable: true
          description: Address for the Ops Group home
      required:
        - geometry
    OpsGroupDateSchedule:
      type: object
      properties:
        start_time:
          type: string
          description: Start time of day represented by HH:mm for all the workers
            belonging to ops group
        end_time:
          type: string
          description: End time of day represented by HH:mm for all the workers belonging
            to ops group
        date:
          type: string
          description: Date for which for all the workers belonging to ops group are
            available for work
        priority:
          type: integer
          nullable: true
          description: Priority of schedule
      required:
        - date
        - end_time
        - start_time
    OpsGroupRecurringSchedule:
      type: object
      properties:
        start_time:
          type: string
          description: Start time of day represented by HH:mm for all the workers
            belonging to ops group
        end_time:
          type: string
          description: End time of day represented by HH:mm for all the workers belonging
            to ops group
        day_of_week:
          type: string
          enum:
            - SUNDAY
            - MONDAY
            - TUESDAY
            - WEDNESDAY
            - THURSDAY
            - FRIDAY
            - SATURDAY
          description: Day of the week when ops group workers are available for work
        priority:
          type: integer
          nullable: true
          description: Priority of schedule
      required:
        - day_of_week
        - end_time
        - start_time
    ApprovalAutomation:
      type: object
      properties:
        auto_cancel:
          type: boolean
          description: Whether to auto-cancel unapproved approvals
        cancel_before_scheduled_in_seconds:
          type: integer
          nullable: true
          description: Time before scheduled at of order to cancel approvals automatically
      required:
        - auto_cancel
    AcceptanceAutomation:
      type: object
      properties:
        auto_cancel:
          type: boolean
          description: Whether to auto-cancel unaccepted acceptances
        cancel_before_scheduled_in_seconds:
          type: integer
          nullable: true
          description: Time before scheduled event to cancel acceptances automatically
      required:
        - auto_cancel
    OpsGroupOrderTrackingAutomation:
      type: object
      properties:
        mode:
          type: string
          enum:
            - auto
            - auto_start
            - auto_stop
          nullable: true
          description: "Controls what automation should occur.

            \            <ul>

            \                <li>`\"auto\"`: Automatically start <em>and</em>
            stop tracking based on the `type`.</li>

            \                <li>`\"auto_start\"`: Only automatically
            <em>start</em> tracking.</li>

            \                <li>`\"auto_stop\"`: Only automatically
            <em>stop</em> tracking.</li>

            \            </ul>

            \            "
        lead_time:
          type: integer
          default: 0
          nullable: true
          minimum: 0
          maximum: 86399
          description: "Defines how <em>early</em> tracking should begin, relative to a
            key event.

            \            <ul>

            \                <li>If `type` is `\"shift\"`: Starts `lead_time`
            seconds <em>before</em> the driver's schedule `start_time`.</li>

            \                <li>If `type` is `\"order\"`: Starts `lead_time`
            seconds <em>before</em> the driver's <strong>first</strong> assigned
            order's `scheduled_at` time.</li>

            \                <li>If `type` is `\"route\"` or
            `\"order_and_route\"`: Starts `lead_time` seconds <em>before</em>
            the driver's assigned route's `scheduled_start_at` time.</li>

            \            </ul>

            \            "
        lag_time:
          type: integer
          default: 0
          nullable: true
          minimum: 0
          maximum: 86399
          description: "Defines how <em>late</em> tracking should stop, relative to a key
            event.

            \            <ul>

            \                <li>If `type` is `\"shift\"`: Stops `lag_time`
            seconds <em>after</em> the driver's schedule `end_time`.</li>

            \                <li>If `type` is `\"order\"`: Stops `lag_time`
            seconds <em>after</em> the driver's <strong>last</strong> order is
            completed.</li>

            \            </ul>

            \            <strong>Important:</strong> Tracking will <em>not</em>
            automatically stop if the driver still has active orders.

            \            "
        type:
          type: string
          enum:
            - manual
            - shift
            - order
            - route
            - order_and_route
          description: "Defines the basis for automation. The value of this field
            determines how the rest of the configuration is interpreted.

            \            <ul>

            \                <li>`\"manual\"`: No automation. Tracking must be
            manually started and stopped. All other fields are ignored.</li>

            \                <li>`\"shift\"`: Automation is based on the
            driver's scheduled shift times.</li>

            \                <li>`\"order\"`: Automation is based on the
            driver's assigned order times.</li>

            \                <li>`\"route\"`: Automation is based on the
            driver's assigned route scheduled start times.</li>

            \                <li>`\"order_and_route\"`: Automation is based on
            the driver's assigned order and route scheduled start times.</li>

            \            </ul>

            \            "
        approval:
          nullable: true
          description: Approval automation settings.
          allOf:
            - $ref: "#/components/schemas/ApprovalAutomation"
        acceptance:
          nullable: true
          description: Acceptance automation settings.
          allOf:
            - $ref: "#/components/schemas/AcceptanceAutomation"
      required:
        - type
    WorkStatusAutomation:
      type: object
      properties:
        mode:
          type: string
          enum:
            - auto
            - auto_start
            - auto_stop
          nullable: true
          description: "Controls what automation should occur.

            \                <ul>

            \                    <li>`\"auto\"`: Automatically toggle
            <em>and</em> work status based on the `type`.</li>

            \                    <li>`\"auto_start\"`: Only automatically set
            <em>start</em> work status based on the `type`.</li>

            \                    <li>`\"auto_stop\"`: Only automatically reset
            <em>stop</em> work status based on the `type`.</li>

            \                </ul>

            \                "
        type:
          type: string
          enum:
            - manual
            - tracking
            - available
          description: "Defines the basis for automation. The value of this field
            determines how the rest of the configuration is interpreted.

            \                <ul>

            \                    <li>`\"manual\"`: No Automation. Work status to
            be managed manually.</li>

            \                    <li>`\"tracking\"`: Automate tracking controls
            based on worker/ops-group schedule.</li>

            \                    <li>`\"available\"`: Automate availability
            controls based on worker/ops-group schedule.</li>

            \                </ul>

            \                "
      required:
        - type
    OpsGroup:
      type: object
      properties:
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group
        ops_group_label:
          type: string
          description: Identifier label for an Ops Group
        timezone:
          type: string
          description: IANA timezone of the Ops Group
        route_start_location:
          type: string
          description: Configuration to identify where routes are expected to start
        route_completion_type:
          type: string
          description: Configuration to identify where routes are expected to end
        objective_fn:
          type: string
          description: Configuration to identify the metric used by the solver when
            generating optimized routes
        ops_group_home:
          description: Location of the Ops Group
          allOf:
            - $ref: "#/components/schemas/OpsGroupHome"
        default_shift_start_time:
          type: string
          description: Default time HH:mm when the shift starts for drivers
        default_shift_end_time:
          type: string
          description: Default time HH:mm when the shift ends for drivers
        route_capacity:
          type: integer
          description: Maximum number of orders in a route
        route_max_distance:
          type: integer
          description: Maximum distance in meters used by the resolver to constrain each
            route distance
        deleted:
          type: boolean
          description: Flag to include deleted ops groups
        deleted_at:
          type: string
          description: Timestamp at which the OpsGroup was deleted
        shift_availability_mode:
          type: string
          description: Flag to start/stop availability of all drivers based on the ops
            group shift
        order_tracking_mode:
          type: string
          nullable: true
          description: Order tracking mode associated with the ops-group
          deprecated: true
        schedule:
          type: array
          nullable: true
          description: List of schedules used for ops group workers for work assignment
            and shift tracking
          items:
            oneOf:
              - $ref: "#/components/schemas/OpsGroupDateSchedule"
              - $ref: "#/components/schemas/OpsGroupRecurringSchedule"
        order_tracking_automation:
          nullable: true
          description: A configuration object to enable/disable and customize automatic
            order tracking.
          allOf:
            - $ref: "#/components/schemas/OpsGroupOrderTrackingAutomation"
        work_status_automation:
          type: array
          nullable: true
          description: 'List of configuration object to enable/disable and customize
            automatic work status updation. If `null`, the default behavior is
            equivalent to: `{"type": "manual"}`.'
          items:
            $ref: "#/components/schemas/WorkStatusAutomation"
        app_config:
          type: object
          nullable: true
          description: Configuration specific to order's app
          additionalProperties:
            nullable: true
        operations_radius:
          type: integer
          nullable: true
          description: Maximum distance in meters from the ops group home within which
            order destinations are allowed
        enforce_operations_radius:
          type: boolean
          nullable: true
          description: Whether to enforce operations_radius validation at order creation
            time
      required:
        - ops_group_handle
        - ops_group_label
        - route_capacity
        - route_max_distance
        - shift_availability_mode
        - timezone
    GetOpsGroupsResponse:
      type: object
      properties:
        pagination_token:
          type: string
          description: Identifier used to fetch the next page of data
        ops_groups:
          type: array
          description: List of Ops Groups
          items:
            $ref: "#/components/schemas/OpsGroup"
    OpsGroupHomeRequest:
      type: object
      properties:
        geometry:
          description: Location of the Ops Group home
          allOf:
            - $ref: "#/components/schemas/LocationGeometry"
        address:
          type: string
          nullable: true
          description: Address of the Ops Group home
      required:
        - geometry
    PostOpsGroupRequest:
      type: object
      properties:
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group
        ops_group_label:
          type: string
          description: Display name for an Ops Group
        route_start_location:
          type: string
          default: live_location
          enum:
            - driver_home
            - ops_group_home
            - live_location
          description: Configuration to identify where routes are expected to start
        route_completion_type:
          type: string
          default: end_at_last_order
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          description: Configuration to identify where routes are expected to end
        objective_fn:
          type: string
          default: minimise_time
          enum:
            - minimise_time
            - minimise_distance
          nullable: true
          description: Configuration to identify the metric used by the solver when
            generating optimized routes
        order_tracking_mode:
          type: string
          nullable: true
          description: Order tracking mode associated with the ops-group
          deprecated: true
        order_tracking_automation:
          nullable: true
          description: 'Controls how and when worker tracking is automatically started and
            stopped. If `null`, the default behavior is equivalent to: `{"type":
            "manual"}`.'
          allOf:
            - $ref: "#/components/schemas/OpsGroupOrderTrackingAutomation"
        work_status_automation:
          type: array
          nullable: true
          description: 'List of configuration object to enable/disable and customize
            automatic work status updation. If `null`, the default behavior is
            equivalent to: `{"type": "manual"}`.'
          items:
            $ref: "#/components/schemas/WorkStatusAutomation"
        ops_group_home:
          nullable: true
          description: Location of the Ops Group
          allOf:
            - $ref: "#/components/schemas/OpsGroupHomeRequest"
        default_shift_start_time:
          type: string
          nullable: true
          description: Default time HH:mm when the shift starts for drivers
        default_shift_end_time:
          type: string
          nullable: true
          description: Default time HH:mm when the shift ends for drivers
        route_capacity:
          type: integer
          nullable: true
          description: Maximum number of orders in a route
        route_max_distance:
          type: integer
          nullable: true
          description: Maximum distance in meters used by the route solver to constrain
            each route distance
        operations_radius:
          type: integer
          nullable: true
          description: Maximum distance in meters from the ops group home within which
            order destinations are allowed
        enforce_operations_radius:
          type: boolean
          nullable: true
          description: Whether to enforce operations_radius validation at order creation
            time
        timezone:
          type: string
          default: UTC
          description: IANA timezone of the Ops Group
        shift_availability_mode:
          type: string
          default: manual
          enum:
            - auto
            - manual
          nullable: true
          description: Flag to start/stop availability of all drivers based on the ops
            group shift
          deprecated: true
        schedule:
          type: array
          nullable: true
          description: List of schedules used for ops group workers matching during order
            planning and auto start/stop of availability or tracking of the
            workers
          items:
            oneOf:
              - $ref: "#/components/schemas/OpsGroupDateSchedule"
              - $ref: "#/components/schemas/OpsGroupRecurringSchedule"
        app_config:
          type: object
          nullable: true
          description: Configuration specific to order's app
          additionalProperties:
            nullable: true
      required:
        - ops_group_handle
        - ops_group_label
    PostOpsGroupResponse:
      type: object
      properties:
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group
        ops_group_label:
          type: string
          description: Identifier label for an Ops Group
        timezone:
          type: string
          description: IANA timezone of the Ops Group
        route_start_location:
          type: string
          description: Configuration to identify where routes are expected to start
        route_completion_type:
          type: string
          description: Configuration to identify where routes are expected to end
        objective_fn:
          type: string
          description: Configuration to identify the metric used by the solver when
            generating optimized routes
        ops_group_home:
          description: Location of the Ops Group
          allOf:
            - $ref: "#/components/schemas/OpsGroupHome"
        default_shift_start_time:
          type: string
          description: Default time HH:mm when the shift starts for drivers
        default_shift_end_time:
          type: string
          description: Default time HH:mm when the shift ends for drivers
        route_capacity:
          type: integer
          description: Maximum number of orders in a route
        route_max_distance:
          type: integer
          description: Maximum distance in meters used by the resolver to constrain each
            route distance
        deleted:
          type: boolean
          description: Flag to include deleted ops groups
        deleted_at:
          type: string
          description: Timestamp at which the OpsGroup was deleted
        shift_availability_mode:
          type: string
          description: Flag to start/stop availability of all drivers based on the ops
            group shift
        order_tracking_mode:
          type: string
          nullable: true
          description: Order tracking mode associated with the ops-group
          deprecated: true
        schedule:
          type: array
          nullable: true
          description: List of schedules used for ops group workers for work assignment
            and shift tracking
          items:
            oneOf:
              - $ref: "#/components/schemas/OpsGroupDateSchedule"
              - $ref: "#/components/schemas/OpsGroupRecurringSchedule"
        order_tracking_automation:
          nullable: true
          description: A configuration object to enable/disable and customize automatic
            order tracking.
          allOf:
            - $ref: "#/components/schemas/OpsGroupOrderTrackingAutomation"
        work_status_automation:
          type: array
          nullable: true
          description: 'List of configuration object to enable/disable and customize
            automatic work status updation. If `null`, the default behavior is
            equivalent to: `{"type": "manual"}`.'
          items:
            $ref: "#/components/schemas/WorkStatusAutomation"
        app_config:
          type: object
          nullable: true
          description: Configuration specific to order's app
          additionalProperties:
            nullable: true
        operations_radius:
          type: integer
          nullable: true
          description: Maximum distance in meters from the ops group home within which
            order destinations are allowed
        enforce_operations_radius:
          type: boolean
          nullable: true
          description: Whether to enforce operations_radius validation at order creation
            time
      required:
        - ops_group_handle
        - ops_group_label
        - route_capacity
        - route_max_distance
        - shift_availability_mode
        - timezone
    ParkingResponse:
      type: object
      properties:
        geometry:
          description: Location geometry for Parking
          allOf:
            - $ref: "#/components/schemas/PointGeometry"
        score:
          type: number
          description: Score representing in the confidence of parking location
        source:
          type: string
          enum:
            - ht_generated
            - visits
          description: Source of the parking
        count:
          type: integer
          nullable: true
          description: Approximate number of parking detected here
      required:
        - geometry
        - score
        - source
    CheckinResponse:
      type: object
      properties:
        geometry:
          description: Location geometry for Parking
          allOf:
            - $ref: "#/components/schemas/PointGeometry"
        score:
          type: number
          description: Score representing in the confidence of checkin location
        source:
          type: string
          enum:
            - ht_generated
            - visits
          description: Source of the checkin
        count:
          type: integer
          nullable: true
          description: Approximate number of checkins detected here
      required:
        - geometry
        - score
        - source
    CompletionResponse:
      type: object
      properties:
        geometry:
          description: Location geometry for Parking
          allOf:
            - $ref: "#/components/schemas/PointGeometry"
        score:
          type: number
          description: Score representing in the confidence of completion location
        source:
          type: string
          enum:
            - ht_generated
            - visits
          description: Source of the completion
        count:
          type: integer
          nullable: true
          description: Approximate number of completions detected here
      required:
        - geometry
        - score
        - source
    ServiceAreaResponse:
      type: object
      properties:
        geometry:
          description: Location geometry for service area
          allOf:
            - $ref: "#/components/schemas/PolygonGeometry"
        source:
          type: string
          enum:
            - ht_generated
            - visits
          description: Source of the service area
        inclusivity:
          type: string
          nullable: true
          description: More inclusivity means more loosely defined service area
      required:
        - geometry
        - source
    OrderDetailPointDestination:
      type: object
      properties:
        parkings:
          type: array
          nullable: true
          description: List of parkings associated with the order destination
          items:
            $ref: "#/components/schemas/ParkingResponse"
        checkins:
          type: array
          nullable: true
          description: List of checkins associated with the order destination
          items:
            $ref: "#/components/schemas/CheckinResponse"
        completions:
          type: array
          nullable: true
          description: List of completion locations associated with the order destination
          items:
            $ref: "#/components/schemas/CompletionResponse"
        service_areas:
          type: array
          nullable: true
          description: List of Geometries where driver spend time when they fulfill the
            order with this destination
          items:
            $ref: "#/components/schemas/ServiceAreaResponse"
        geometry:
          description: GeoJSON representation of point geometry for the order destination
          allOf:
            - $ref: "#/components/schemas/PointGeometry"
        address:
          type: string
          nullable: true
          description: Address for the order destination
        geofence_id:
          type: string
          nullable: true
          description: Geofence ID of the order destination
        place_handle:
          type: string
          nullable: true
          description: Place Handle of the order destination
        place_id:
          type: string
          nullable: true
          description: Place ID of the order destination
        radius:
          type: integer
          default: 100
          description: Radius (in meters) of the circular geofence representing the order
            destination, typically between 25m and 200m
      required:
        - geometry
    OrderDetailPolygonDestination:
      type: object
      properties:
        parkings:
          type: array
          nullable: true
          description: List of parkings associated with the order destination
          items:
            $ref: "#/components/schemas/ParkingResponse"
        checkins:
          type: array
          nullable: true
          description: List of checkins associated with the order destination
          items:
            $ref: "#/components/schemas/CheckinResponse"
        completions:
          type: array
          nullable: true
          description: List of completion locations associated with the order destination
          items:
            $ref: "#/components/schemas/CompletionResponse"
        service_areas:
          type: array
          nullable: true
          description: List of Geometries where driver spend time when they fulfill the
            order with this destination
          items:
            $ref: "#/components/schemas/ServiceAreaResponse"
        geometry:
          description: GeoJSON representation of polygon geometry for the order destination
          allOf:
            - $ref: "#/components/schemas/PolygonGeometry"
        address:
          type: string
          nullable: true
          description: Address for the order destination
        geofence_id:
          type: string
          nullable: true
          description: Geofence ID of the order destination
        place_handle:
          type: string
          nullable: true
          description: Place Handle of the order destination
        place_id:
          type: string
          nullable: true
          description: Place ID of the order destination
      required:
        - geometry
    OrderDetailGeofenceIdDestination:
      type: object
      properties:
        parkings:
          type: array
          nullable: true
          description: List of parkings associated with the order destination
          items:
            $ref: "#/components/schemas/ParkingResponse"
        checkins:
          type: array
          nullable: true
          description: List of checkins associated with the order destination
          items:
            $ref: "#/components/schemas/CheckinResponse"
        completions:
          type: array
          nullable: true
          description: List of completion locations associated with the order destination
          items:
            $ref: "#/components/schemas/CompletionResponse"
        service_areas:
          type: array
          nullable: true
          description: List of Geometries where driver spend time when they fulfill the
            order with this destination
          items:
            $ref: "#/components/schemas/ServiceAreaResponse"
        geofence_id:
          type: string
          description: Geofence ID to extract geometry from. This is a legacy feature,
            prefer using `place_handle` now
          deprecated: true
        address:
          type: string
          nullable: true
          description: Address for the order destination
      required:
        - geofence_id
    OrderDetailPlaceHandleDestination:
      type: object
      properties:
        parkings:
          type: array
          nullable: true
          description: List of parkings associated with the order destination
          items:
            $ref: "#/components/schemas/ParkingResponse"
        checkins:
          type: array
          nullable: true
          description: List of checkins associated with the order destination
          items:
            $ref: "#/components/schemas/CheckinResponse"
        completions:
          type: array
          nullable: true
          description: List of completion locations associated with the order destination
          items:
            $ref: "#/components/schemas/CompletionResponse"
        service_areas:
          type: array
          nullable: true
          description: List of Geometries where driver spend time when they fulfill the
            order with this destination
          items:
            $ref: "#/components/schemas/ServiceAreaResponse"
        place_handle:
          type: string
          description: Place Handle to extract geometry from
        address:
          type: string
          nullable: true
          description: Address for the order destination
      required:
        - place_handle
    OrderDetailEstimate:
      type: object
      properties:
        start_at:
          type: string
          nullable: true
          description: Estimated timestamp by which a driver should start travelling to
            fulfill all the orders on time
        start_by:
          type: string
          nullable: true
          description: Estimated timestamp by which a driver should start travelling to
            fulfill all the orders on time
        arrive_at:
          type: string
          nullable: true
          description: Estimated timestamp by which a driver should arrive at order
            destination
        distance:
          type: integer
          nullable: true
          description: Estimated total distance that the driver should travel
        duration:
          type: integer
          nullable: true
          description: Estimated total time that the driver should spend to fulfill all
            orders in the route
        initial_arrive_at:
          type: string
          nullable: true
          description: Initial Estimated timestamp by which a driver should arrive at the
            destination
        current_worker_location:
          nullable: true
          description: Current Worker location details
          allOf:
            - $ref: "#/components/schemas/DriverLocation"
        polyline:
          nullable: true
          description: Estimated optimal path that the driver should take to fulfill all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/EstimatePolyline"
        start_location:
          nullable: true
          description: The starting point location from where the driver begins their
            journey for the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: The final destination location where the route ends after
            completing all orders
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
    PointLocationGeometryResponse:
      type: object
      properties:
        type:
          enum:
            - Point
          description: Point Geometry type
        coordinates:
          type: array
          description: Location coordinates represented as [longitude, latitude].
          items:
            type: number
      required:
        - coordinates
        - type
    FulfillmentAttempt:
      type: object
      properties:
        order_handle:
          type: string
          description: ""
        fulfillment_attempt:
          type: integer
          description: ""
      required:
        - fulfillment_attempt
        - order_handle
    OrderParkingResponse:
      type: object
      properties:
        geometry:
          description: Location geometry for Parking
          allOf:
            - $ref: "#/components/schemas/PointGeometry"
        score:
          type: number
          description: Score representing in the confidence of parking location
        timestamp:
          type: string
          description: Timestamp of parking
      required:
        - geometry
        - score
        - timestamp
    OrderCheckinResponse:
      type: object
      properties:
        geometry:
          description: Location geometry for Parking
          allOf:
            - $ref: "#/components/schemas/PointGeometry"
        score:
          type: number
          description: Score representing in the confidence of checkin location
        timestamp:
          type: string
          description: Timestamp of checkin
      required:
        - geometry
        - score
        - timestamp
    OrderServiceAreaResponse:
      type: object
      properties:
        geometry:
          description: Location geometry for service area
          allOf:
            - $ref: "#/components/schemas/PolygonGeometry"
        time_spent:
          type: number
          description: Time spent while servicing the order
      required:
        - geometry
        - time_spent
    LocationGeometryModel:
      type: object
      properties:
        type:
          type: string
          description: Geometry type.
        coordinates:
          description: Geo coordinates (lon, lat)
          oneOf:
            - type: array
              items:
                type: number
            - type: array
              items:
                type: array
                items:
                  type: array
                  items:
                    type: number
      required:
        - coordinates
        - type
    ActivityDetail:
      type: object
      properties:
        steps:
          type: integer
          nullable: true
          description: Number of steps
        distance:
          type: integer
          nullable: true
          description: Distance in metres
        duration:
          type: integer
          nullable: true
          description: Duration in seconds
    PolylineGeometry:
      type: object
      properties:
        type:
          type: string
          description: geometry type
        coordinates:
          type: array
          nullable: true
          description: "centre coordinates: lon, lat"
          items:
            type: array
            items:
              type: number
      required:
        - type
    PolylineProperties:
      type: object
      properties:
        timestamps:
          type: array
          nullable: true
          description: list of timestamps, one for each location in polyline.
          items:
            type: string
    PolylineGeoJSON:
      type: object
      properties:
        type:
          type: string
          description: type
        geometry:
          description: geojson geometry
          allOf:
            - $ref: "#/components/schemas/PolylineGeometry"
        properties:
          description: geojson properties
          allOf:
            - $ref: "#/components/schemas/PolylineProperties"
      required:
        - geometry
        - properties
        - type
    PolygonHeatMap:
      type: object
      properties:
        geometry:
          description: polygon geometry
          allOf:
            - $ref: "#/components/schemas/PolygonGeometry"
        time_spent:
          type: number
          description: time spent at the polygon
      required:
        - geometry
        - time_spent
    DriverActivityEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_activity_event
          description: String indicating the type of timeline event.
        recorded_at_start:
          type: string
          nullable: true
          description: Timestamp indicating the beginning of the event.
        recorded_at_end:
          type: string
          nullable: true
          description: Timestamp indicating the end of the event
        location_start:
          nullable: true
          description: Location of the device at the beginning of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_end:
          nullable: true
          description: Location of the device at the end of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        detail:
          nullable: true
          description: Details of activity ex. distance (metres), duration (seconds),
            steps (number)
          allOf:
            - $ref: "#/components/schemas/ActivityDetail"
        activity:
          type: string
          nullable: true
          description: "type of activity: drive/stop/walk"
        marker_id:
          type: string
          nullable: true
          description: event id
        split_marker_id:
          type: string
          nullable: true
          description: marker id if the marker is split
        is_partial:
          type: boolean
          description: flag indicating if the activity is trimmed.
        is_ongoing:
          type: boolean
          description: flag indicating if the activity is ongoing.
        polyline:
          nullable: true
          description: polyline associated with the activity
          allOf:
            - $ref: "#/components/schemas/PolylineGeoJSON"
        address:
          type: string
          nullable: true
          description: address associated with activity
        source_locations:
          type: string
          writeOnly: true
          nullable: true
          description: source locations
        hex_map:
          type: array
          nullable: true
          description: location heatmap for stop activity
          items:
            $ref: "#/components/schemas/PolygonHeatMap"
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
        battery_details:
          nullable: true
          description: Details of battery usage during the event.
          allOf:
            - $ref: "#/components/schemas/ActivityBatteryDetails"
      required:
        - is_ongoing
        - is_partial
        - type
    DriverOutageEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_outage_event
          description: String indicating the type of timeline event.
        recorded_at_start:
          type: string
          nullable: true
          description: Timestamp indicating the beginning of the event.
        recorded_at_end:
          type: string
          nullable: true
          description: Timestamp indicating the end of the event
        location_start:
          nullable: true
          description: Location of the device at the beginning of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_end:
          nullable: true
          description: Location of the device at the end of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        marker_id:
          type: string
          nullable: true
          description: unique id
        split_marker_id:
          type: string
          nullable: true
          description: marker id if the marker is split
        outage_code:
          type: string
          description: Code indicating the type of outage
        outage_label:
          type: string
          description: Text indicating the type of outage
        outage_is_user_generated:
          type: boolean
          description: Flag indicating if the outage is user generated.
        outage_description:
          type: string
          description: Text describing the outage and resolution.
        outage_category:
          type: string
          enum:
            - behavioural
            - adversarial
            - reachability
            - os
            - sporadic
          description: String indicating the category of outage
        detail:
          nullable: true
          description: "Details associated with outage: distance/duration etc."
          allOf:
            - $ref: "#/components/schemas/ActivityDetail"
        is_partial:
          type: boolean
          description: flag indicating if the outage is partial.
        is_ongoing:
          type: boolean
          description: flag indicating if the activity is ongoing.
        polyline:
          nullable: true
          description: estimated polyline associated with the outage
          allOf:
            - $ref: "#/components/schemas/PolylineGeoJSON"
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
      required:
        - is_ongoing
        - is_partial
        - outage_category
        - outage_code
        - outage_description
        - outage_is_user_generated
        - outage_label
        - type
    StatusDetail:
      type: object
      properties:
        actor:
          enum:
            - business
            - hypertrack
          nullable: true
          description: Source of the action that updated the status.
    DriverStatusUpdatedEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_status_updated
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        tracking:
          type: boolean
          nullable: true
          description: Boolean flag indicating tracking status.
        marker_id:
          type: string
          nullable: true
          description: unique id
        driver_handle:
          type: string
          nullable: true
          description: handle of the driver
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
        detail:
          nullable: true
          description: Details of the status update.
          allOf:
            - $ref: "#/components/schemas/StatusDetail"
      required:
        - type
    OrderCreatedEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_created
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          description: handle of the driver
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
      required:
        - type
    OrderAssignedEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_assigned
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          description: handle of the driver
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
      required:
        - type
    OrderStartedEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_started
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          description: handle of the driver
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
      required:
        - type
    OrderCompletedEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_completed
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          description: handle of the driver
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
      required:
        - type
    OrderCancelledEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_cancelled
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          description: handle of the driver
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
      required:
        - type
    EventLocationGeometry:
      type: object
      properties:
        geometry:
          nullable: true
          allOf:
            - $ref: "#/components/schemas/PointGeometry"
        recorded_at:
          type: string
          nullable: true
        accuracy:
          type: integer
          nullable: true
    OrderEnterExitEvent:
      type: object
      properties:
        order_handle:
          type: string
          nullable: true
          description: ""
        order_id:
          type: string
          nullable: true
          description: ""
        order_type:
          type: string
          nullable: true
          description: ""
        fulfillment_attempt:
          type: integer
          nullable: true
          description: ""
        location:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/EventLocationGeometry"
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        event_id:
          type: string
          description: Unique id of the event
        type:
          type: string
          enum:
            - order_geofence_exited
            - order_geofence_entered
            - order_service_ended
            - order_service_started
          description: Type of event
        distance:
          type: integer
          nullable: true
          description: ""
        duration:
          type: integer
          nullable: true
          description: ""
        linked_event_ids:
          type: array
          nullable: true
          description: Ids of the event associated with this event
          items:
            type: string
        address:
          type: string
          nullable: true
          description: ""
        outside_scope:
          type: boolean
          default: false
          description: Whether the geofence event happened after route start but before
            order start.
      required:
        - event_id
        - type
    InferredEventDeviation:
      type: object
      properties:
        distance:
          type: integer
          nullable: true
          description: ""
        duration:
          type: integer
          nullable: true
          description: ""
    OrderInferredEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - check_in
            - check_out
          description: Type of event
        inferred:
          type: boolean
          nullable: true
          description: ""
        location:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/EventLocationGeometry"
        address:
          type: string
          nullable: true
          description: ""
        deviation:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/InferredEventDeviation"
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        event_id:
          type: string
          description: Unique id of the event
        linked_event_ids:
          type: array
          nullable: true
          description: Ids of the event associated with this event
          items:
            type: string
      required:
        - event_id
        - type
    PointLocation1:
      type: object
      properties:
        geometry:
          description: Location geometry representing a point
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometry"
        accuracy:
          type: number
          nullable: true
          description: Accuracy in meters for the location
      required:
        - geometry
    OrderCustomEvent:
      type: object
      properties:
        recorded_at:
          type: string
          description: Event recording time
        location:
          nullable: true
          description: end time of marker
          allOf:
            - $ref: "#/components/schemas/PointLocation1"
        type:
          type: string
          description: Type of custom event
      required:
        - recorded_at
        - type
    Event:
      type: object
      properties:
        event_id:
          type: string
          description: Type of event
        type:
          type: string
          description: Type of event
      required:
        - event_id
        - type
    OrderServiceEvent:
      type: object
      properties:
        start_reason:
          type: string
          description: Start event type for service event.
        end_reason:
          type: string
          description: End event type for service event.
        data:
          type: array
          description: Event list having information of event_id and type
          items:
            $ref: "#/components/schemas/Event"
        recorded_at_start:
          type: string
          nullable: true
          description: Time stamp for the first event.
        recorded_at_end:
          type: string
          nullable: true
          description: Time stamp for the last event.
        type:
          type: string
          enum:
            - order_service
          description: Type of event having service related information.
      required:
        - data
        - end_reason
        - start_reason
        - type
    DriverDeviceLinkedEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_device_linked_event
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          description: Timestamp indicating the beginning of the device session.
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_recorded_at:
          type: string
          nullable: true
          description: Timestamp when the location was recorded.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          description: Unique ID of device
        device_info:
          nullable: true
          description: Device information
          allOf:
            - $ref: "#/components/schemas/DeviceInfo"
        former_associated_workers:
          type: array
          nullable: true
          description: List of workers connected to this device in the last 2 days
          items:
            nullable: true
      required:
        - device_id
        - recorded_at
        - type
    DriverDeviceUnlinkedEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_device_unlinked_event
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          description: Timestamp indicating the end of the device session.
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_recorded_at:
          type: string
          nullable: true
          description: Timestamp when the location was recorded.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          description: Unique ID of device
        device_info:
          nullable: true
          description: Device information
          allOf:
            - $ref: "#/components/schemas/DeviceInfo"
        unlink_duration:
          type: integer
          nullable: true
          description: Duration in seconds indicating how long the worker remained
            unlinked from the device.
        unlinked_due_to_logout:
          type: boolean
          nullable: true
          description: Flag indicating whether the device was unlinked as a result of a
            logout event.
      required:
        - device_id
        - recorded_at
        - type
    DeviceDisconnectedEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_outage_event
          description: String indicating the type of timeline event.
        recorded_at_start:
          type: string
          nullable: true
          description: Timestamp indicating the beginning of the event.
        recorded_at_end:
          type: string
          nullable: true
          description: Timestamp indicating the end of the event
        location_start:
          nullable: true
          description: Location of the device at the beginning of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_end:
          nullable: true
          description: Location of the device at the end of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          description: Unique ID of device
        marker_id:
          type: string
          nullable: true
          description: unique id
        split_marker_id:
          type: string
          nullable: true
          description: marker id if the marker is split
        disconnected_code:
          type: string
          description: Code indicating the type of disconnected event
        disconnected_label:
          type: string
          description: Text indicating the type of disconnected event
        disconnected_description:
          type: string
          description: Text describing the disconnected event.
        detail:
          nullable: true
          description: "Details associated with disconnected event: distance/duration etc."
          allOf:
            - $ref: "#/components/schemas/ActivityDetail"
        is_partial:
          type: boolean
          description: flag indicating if the outage is partial.
        is_ongoing:
          type: boolean
          description: flag indicating if the activity is ongoing.
      required:
        - device_id
        - disconnected_code
        - disconnected_description
        - disconnected_label
        - is_ongoing
        - is_partial
        - type
    BillingBreakTimeModel:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the breaktime.
        start_time:
          type: string
          description: Timestamp indicating the start of breaktime.
        end_time:
          type: string
          description: Timestamp indicating the end of breaktime.
      required:
        - end_time
        - id
        - start_time
    OrderBillingDetails:
      type: object
      properties:
        billable_hours:
          type: number
          description: Total billable hours computed for the order.
        travel_time:
          type: integer
          description: Time spent traveling to the order destination.
        service_time:
          type: integer
          description: Time spent servicing the order.
        breaks:
          type: array
          nullable: true
          description: List of breaks observed during the order.
          items:
            $ref: "#/components/schemas/BillingBreakTimeModel"
      required:
        - billable_hours
        - service_time
        - travel_time
    OrderTaskResponse:
      type: object
      properties:
        label:
          type: string
          description: Type of task to be created for the order.
        task_definition_id:
          type: string
          nullable: true
          description: Id of the tasks definition from which this task is picked
        description:
          type: string
          nullable: true
          description: Description of the task type.
        metadata:
          type: object
          nullable: true
          description: Additional metadata for the task.
          additionalProperties:
            nullable: true
        priority:
          type: string
          enum:
            - none
            - low
            - medium
            - high
          nullable: true
          description: Priority of the task. Valid values are none, low, medium, high.
        task_id:
          type: string
          description: Unique identifier for the created task.
        status:
          type: string
          nullable: true
          description: Status of the task. Valid values are pending, ongoing, completed,
            cancelled.
        created_at:
          type: string
          description: Timestamp when the task was created.
        updated_at:
          type: string
          nullable: true
          description: Timestamp when the task was last updated.
        attachments:
          type: array
          nullable: true
          description: Attachments associated with the event
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
      required:
        - created_at
        - label
        - task_id
    OrderMetrics:
      type: object
      properties:
        before_shift_duration:
          type: integer
          description: Total duration before the shift started.
        after_shift_duration:
          type: integer
          description: Total duration after the shift ended.
        on_shift_duration:
          type: integer
          description: Total duration during the shift including breaks.
        before_shift_distance:
          type: integer
          description: Total distance covered before the shift started.
        after_shift_distance:
          type: integer
          description: Total distance covered after the shift ended.
        on_shift_distance:
          type: integer
          description: Total distance covered during the shift including breaks.
      required:
        - after_shift_distance
        - after_shift_duration
        - before_shift_distance
        - before_shift_duration
        - on_shift_distance
        - on_shift_duration
    BreakEntry:
      type: object
      properties:
        type:
          type: string
          description: Break type (e.g. "meal", "rest").
        start_time:
          type: string
          description: ISO 8601 timestamp when the break started.
        end_time:
          type: string
          description: ISO 8601 timestamp when the break ended.
        duration:
          type: integer
          description: Break duration in seconds.
      required:
        - duration
        - end_time
        - start_time
        - type
    HypertrackLocationTimesheet:
      type: object
      properties:
        source:
          type: string
          description: Always hypertrack-location. Identifies this as a
            HyperTrack-computed entry.
        type:
          type: string
          description: Always location. Distinguishes this computation type from future
            types.
        start_time:
          type: string
          nullable: true
          description: ISO 8601 timestamp when the worker arrived on site (first geofence
            entry). Null if the worker never entered the destination geofence.
        end_time:
          type: string
          nullable: true
          description: ISO 8601 timestamp when the worker left the site (last geofence
            exit). Null if the worker was still inside at order closure.
        total_duration_on_premises:
          type: integer
          description: Total seconds the worker spent at the destination (sum of geofence
            visit durations).
        total_break_duration:
          type: integer
          description: Residual seconds not at the destination. Equals (end_time -
            start_time) - total_duration_on_premises.
        breaks:
          type: array
          nullable: true
          description: Geofence exit→re-entry windows representing time away from the
            destination. Each entry has start_time, end_time, and duration
            (seconds). Null when there are no exit→re-entry gaps.
          items:
            $ref: "#/components/schemas/BreakEntry"
        finalized:
          type: boolean
          description: Always true. Signals this entry was computed at order completion
            and will not change.
      required:
        - finalized
        - source
        - total_break_duration
        - total_duration_on_premises
        - type
    AgentBreakEntry:
      type: object
      properties:
        type:
          type: string
          nullable: true
          description: Break type (e.g. "meal", "rest").
        start_time:
          type: string
          nullable: true
          description: ISO 8601 timestamp when the break started.
        end_time:
          type: string
          nullable: true
          description: ISO 8601 timestamp when the break ended.
        duration:
          type: integer
          nullable: true
          description: Break duration in seconds.
        reasoning:
          type: string
          nullable: true
          description: Detailed reasoning for how this break was inferred from the
            timeline events, including steps, valid contained events, and POI
            matches.
    AgentTimesheetEntry:
      type: object
      properties:
        type:
          type: string
          description: "Entry type: worker (customer-submitted), facility, or reconciled
            (agent-approved)."
        source:
          type: string
          description: Collection channel through which the entry was captured (e.g.
            "sms", "email", "ops"). This is the closeout copilot's internal
            channel, distinct from the top-level timesheets entries where
            `source` indicates origin.
        start_time:
          type: string
          nullable: true
          description: ISO 8601 timestamp when the shift started.
        end_time:
          type: string
          nullable: true
          description: ISO 8601 timestamp when the shift ended.
        breaks:
          type: array
          nullable: true
          description: Declared break periods. Each entry has start_time, end_time,
            duration (seconds), and type (e.g. "meal").
          items:
            $ref: "#/components/schemas/AgentBreakEntry"
        total_duration_on_premises:
          type: integer
          nullable: true
          description: Total seconds the worker spent on site (sum of geofence visit
            durations).
        total_break_duration:
          type: integer
          nullable: true
          description: Total break duration in seconds.
        finalized:
          type: boolean
          nullable: true
          description: Whether this timesheet entry is finalized and will not change.
        narrative:
          type: string
          nullable: true
          description: Human-readable summary of the shift compiled by the closeout copilot.
        notes:
          type: string
          nullable: true
          description: Human-readable notes about the entry.
      required:
        - source
        - type
    AgentReview:
      type: object
      properties:
        status:
          type: string
          nullable: true
          description: Closeout review status (e.g. "approved"). Null when no review has
            taken place.
        timesheets:
          type: array
          nullable: true
          description: Agent-collected or agent-reconciled timesheet entries.
          items:
            $ref: "#/components/schemas/AgentTimesheetEntry"
    GetOrderTimelineResponse:
      type: object
      properties:
        timezone:
          type: string
          nullable: true
          description: Time zone
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        created_by:
          nullable: true
          description: Who created the order
          allOf:
            - $ref: "#/components/schemas/Source"
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        destination:
          nullable: true
          description: Destination for the order
          oneOf:
            - $ref: "#/components/schemas/OrderDetailPointDestination"
            - $ref: "#/components/schemas/OrderDetailPolygonDestination"
            - $ref: "#/components/schemas/OrderDetailGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderDetailPlaceHandleDestination"
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the order is associated
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the order was planned - `manual`, `scheduled`
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderDetailEstimate"
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify if the order is a pick/drop
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        plan_id:
          type: string
          nullable: true
          description: Unique identifier of the plan
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the order is tracked in flex, on_time,
            on_shift, full_shift or pre_shift mode
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Total time tracked in seconds for the driver at the location when
            fulfilling the order
        polyline:
          nullable: true
          description: GeoJSON representation of polyline with the coordinates of the
            actual path travelled by the driver
          allOf:
            - $ref: "#/components/schemas/Polyline"
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
        cancelled_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was cancelled at destination
        visited_destination:
          type: boolean
          nullable: true
          description: Indicates whether the driver visited the destination
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the order
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking once the order was
            fulfilled or cancelled
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        images:
          type: array
          nullable: true
          description: List of URLs to be used to retrieve images associated with the order
          items:
            type: string
        order_score:
          type: number
          nullable: true
          description: ""
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        previous_fulfillments:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/FulfillmentAttempt"
        parking:
          type: array
          nullable: true
          description: Parkings associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderParkingResponse"
        checkin:
          type: array
          nullable: true
          description: Checkins associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderCheckinResponse"
        service_area:
          type: array
          nullable: true
          description: Service Areas associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderServiceAreaResponse"
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first location after device's tracking
            is initiated for the route
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first event after device's tracking is
            initiated for the route
        timeline:
          type: array
          nullable: true
          description: New Order timeline events sorted by event time
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverActivityEvent"
              - $ref: "#/components/schemas/DriverOutageEvent"
              - $ref: "#/components/schemas/DriverStatusUpdatedEvent"
              - $ref: "#/components/schemas/OrderCreatedEvent"
              - $ref: "#/components/schemas/OrderAssignedEvent"
              - $ref: "#/components/schemas/OrderStartedEvent"
              - $ref: "#/components/schemas/OrderCompletedEvent"
              - $ref: "#/components/schemas/OrderCancelledEvent"
              - $ref: "#/components/schemas/OrderEnterExitEvent"
              - $ref: "#/components/schemas/OrderInferredEvent"
              - $ref: "#/components/schemas/OrderCustomEvent"
              - $ref: "#/components/schemas/OrderServiceEvent"
              - $ref: "#/components/schemas/DriverDeviceLinkedEvent"
              - $ref: "#/components/schemas/DriverDeviceUnlinkedEvent"
              - $ref: "#/components/schemas/DeviceDisconnectedEvent"
        worker_name:
          type: string
          nullable: true
          description: Name of the worker to whom order is assigned.
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which order is expected to switch device
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        billing_details:
          nullable: true
          description: Billing details for the order.
          allOf:
            - $ref: "#/components/schemas/OrderBillingDetails"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order
        tasks:
          type: array
          nullable: true
          description: tasks associated with the order
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
        metrics:
          nullable: true
          description: Metrics associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderMetrics"
        timesheets:
          type: array
          nullable: true
          description: Timesheet entries for the order. Includes HyperTrack-computed
            (HypertrackLocationTimesheet) and customer-provided entries.
          items:
            oneOf:
              - $ref: "#/components/schemas/HypertrackLocationTimesheet"
              - type: object
                additionalProperties:
                  nullable: true
        agent:
          nullable: true
          description: Closeout copilot review data. Contains a `status` field (e.g.
            "approved") and a `timesheets` list of agent-collected or
            agent-reconciled entries. Null when closeout is not enabled or no
            review has taken place.
          allOf:
            - $ref: "#/components/schemas/AgentReview"
        service_started_at:
          type: string
          nullable: true
          description: Timestamp at which the service is considered started by either
            entering the order destination or clocking in
        service_ended_at:
          type: string
          nullable: true
          description: Timestamp at which the service is considered ended by either
            exiting the order destination or clocking out
      required:
        - order_handle
        - status
    PatchOrderRequest:
      type: object
      properties:
        metadata:
          type: object
          nullable: true
          additionalProperties:
            nullable: true
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment"
              - $ref: "#/components/schemas/NoteAttachment"
              - $ref: "#/components/schemas/SignatureAttachment"
        destination:
          nullable: true
          description: Destination of the order. This field can only be updated before
            tracking is started for an order.
          oneOf:
            - $ref: "#/components/schemas/OrderListPolygonDestination"
            - $ref: "#/components/schemas/OrderListPointDestination"
            - $ref: "#/components/schemas/OrderListGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderListPlaceHandleDestination"
        scheduled_at:
          type: string
          nullable: true
          description: Schedule time by which order needs to be fulfilled. May be updated
            on `ongoing` orders.
        scheduled_after:
          type: string
          nullable: true
          description: Schedule time after which the worker needs to fulfill order
            (similar to slot start). May be updated on `ongoing` orders.
        expected_service_time:
          type: integer
          nullable: true
          description: Specified in seconds.
        product_type:
          type: array
          nullable: true
          description: Array of string representing skills required to fulfill the order
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Type of Order
        type_index:
          type: integer
          nullable: true
          description: Type index of the order, used in pick/drop scenario
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric units which is to be occupied by the order
        ops_group_handle:
          type: string
          nullable: true
          description: Unique Handle of Ops Group to which order needs to be reassigned
        timesheets:
          type: array
          nullable: true
          description: Only used when the order is in standalone closeout mode; forwarded
            as-is to closeout-copilot.
          items:
            type: object
            additionalProperties:
              nullable: true
        worker_locations:
          type: array
          nullable: true
          description: Only used when the order is in standalone closeout mode; forwarded
            as-is to closeout-copilot.
          items:
            type: object
            additionalProperties:
              nullable: true
        messages:
          type: array
          nullable: true
          description: Only used when the order is in standalone closeout mode; forwarded
            as-is to closeout-copilot.
          items:
            type: object
            additionalProperties:
              nullable: true
        facility_name:
          type: string
          nullable: true
          description: Only used when the order is in standalone closeout mode; forwarded
            as-is to closeout-copilot.
    PatchOrderResponse:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        created_by:
          nullable: true
          description: Who created the order
          allOf:
            - $ref: "#/components/schemas/Source"
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        destination:
          nullable: true
          description: Destination for the order
          oneOf:
            - $ref: "#/components/schemas/OrderDetailPointDestination"
            - $ref: "#/components/schemas/OrderDetailPolygonDestination"
            - $ref: "#/components/schemas/OrderDetailGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderDetailPlaceHandleDestination"
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the order is associated
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the order was planned - `manual`, `scheduled`
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderDetailEstimate"
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify if the order is a pick/drop
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        plan_id:
          type: string
          nullable: true
          description: Unique identifier of the plan
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the order is tracked in flex, on_time,
            on_shift, full_shift or pre_shift mode
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Total time tracked in seconds for the driver at the location when
            fulfilling the order
        polyline:
          nullable: true
          description: GeoJSON representation of polyline with the coordinates of the
            actual path travelled by the driver
          allOf:
            - $ref: "#/components/schemas/Polyline"
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
        cancelled_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was cancelled at destination
        visited_destination:
          type: boolean
          nullable: true
          description: Indicates whether the driver visited the destination
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the order
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking once the order was
            fulfilled or cancelled
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        images:
          type: array
          nullable: true
          description: List of URLs to be used to retrieve images associated with the order
          items:
            type: string
        order_score:
          type: number
          nullable: true
          description: ""
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        previous_fulfillments:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/FulfillmentAttempt"
        parking:
          type: array
          nullable: true
          description: Parkings associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderParkingResponse"
        checkin:
          type: array
          nullable: true
          description: Checkins associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderCheckinResponse"
        service_area:
          type: array
          nullable: true
          description: Service Areas associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderServiceAreaResponse"
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first location after device's tracking
            is initiated for the route
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first event after device's tracking is
            initiated for the route
        timeline:
          type: array
          nullable: true
          description: New Order timeline events sorted by event time
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverActivityEvent"
              - $ref: "#/components/schemas/DriverOutageEvent"
              - $ref: "#/components/schemas/DriverStatusUpdatedEvent"
              - $ref: "#/components/schemas/OrderCreatedEvent"
              - $ref: "#/components/schemas/OrderAssignedEvent"
              - $ref: "#/components/schemas/OrderStartedEvent"
              - $ref: "#/components/schemas/OrderCompletedEvent"
              - $ref: "#/components/schemas/OrderCancelledEvent"
              - $ref: "#/components/schemas/OrderEnterExitEvent"
              - $ref: "#/components/schemas/OrderInferredEvent"
              - $ref: "#/components/schemas/OrderCustomEvent"
              - $ref: "#/components/schemas/OrderServiceEvent"
              - $ref: "#/components/schemas/DriverDeviceLinkedEvent"
              - $ref: "#/components/schemas/DriverDeviceUnlinkedEvent"
              - $ref: "#/components/schemas/DeviceDisconnectedEvent"
        worker_name:
          type: string
          nullable: true
          description: Name of the worker to whom order is assigned.
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which order is expected to switch device
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        billing_details:
          nullable: true
          description: Billing details for the order.
          allOf:
            - $ref: "#/components/schemas/OrderBillingDetails"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order
        tasks:
          type: array
          nullable: true
          description: tasks associated with the order
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
        metrics:
          nullable: true
          description: Metrics associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderMetrics"
        timesheets:
          type: array
          nullable: true
          description: Timesheet entries for the order. Includes HyperTrack-computed
            (HypertrackLocationTimesheet) and customer-provided entries.
          items:
            oneOf:
              - $ref: "#/components/schemas/HypertrackLocationTimesheet"
              - type: object
                additionalProperties:
                  nullable: true
        agent:
          nullable: true
          description: Closeout copilot review data. Contains a `status` field (e.g.
            "approved") and a `timesheets` list of agent-collected or
            agent-reconciled entries. Null when closeout is not enabled or no
            review has taken place.
          allOf:
            - $ref: "#/components/schemas/AgentReview"
      required:
        - order_handle
        - status
    PlanRoute:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteListOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteListEstimate"
        plan_id:
          type: string
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
      required:
        - created_at
        - embed_url
        - orders
        - plan_id
        - plan_mode
        - planned_at
        - route_handle
        - status
        - version
    GetPlanResponse:
      type: object
      properties:
        plan_id:
          type: string
          description: Unique ID of the plan.
        sequence_number:
          type: integer
          description: Sequence number of the latest planning run.
        routes:
          type: array
          description: List of routes planned as part of this plan.
          items:
            $ref: "#/components/schemas/PlanRoute"
        unplanned_orders:
          type: array
          description: List of orders which has not been planned.
          items:
            $ref: "#/components/schemas/OrderObjectMini"
        status:
          type: string
          enum:
            - failed
            - completed
            - planning
          description: Status of the plan based on the latest planning run.
        started_at:
          type: string
          description: Timestamp representing the start time of latest planning run for
            the plan.
        created_at:
          type: string
          description: Timestamp representing the creation time of the plan.
        ops_group_handle:
          type: string
          description: Unique Handle of ops group handle of the plan.
        fulfillment_date:
          type: string
          description: Date (YYYY-MM-DD) representing the fulfillment date of plan.
        failure_reason:
          type: string
          description: Reason of failure of the latest planning run for plan. Sample
            values are listed below.</br><ul><li> Ops group location cannot be
            the same as an order location</li> <li>Could not resolve country
            when planning orders</li> <li>Could not resolve ISO3 country_code
            for country</li> <li>Route planning is currently not enabled for
            country</li></ul>
        summary:
          description: Summary of the plan
          allOf:
            - $ref: "#/components/schemas/PlanSummary"
      required:
        - created_at
        - fulfillment_date
        - ops_group_handle
        - plan_id
        - sequence_number
        - started_at
        - status
        - summary
    LocationResponse:
      type: object
      properties:
        address:
          type: string
          nullable: true
          description: Address for the location
        geometry:
          description: Location geometry
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        radius:
          type: integer
          nullable: true
          description: Radius around POINT geometry to define the bounds of this location
        accuracy:
          type: number
          nullable: true
          description: Accuracy in meters for the location
        bearing:
          type: number
          nullable: true
          description: Directional position in degrees for the location
        speed:
          type: number
          nullable: true
          description: Speed in meters per second at this location
      required:
        - geometry
    TimeSeriesLocation:
      type: object
      properties:
        lat:
          type: number
          description: Latitude of the location
        lon:
          type: number
          description: Longitude of the driver
        timestamp:
          type: string
          description: Time when location was recorded
      required:
        - lat
        - lon
        - timestamp
    TripSummary:
      type: object
      properties:
        distance:
          type: integer
          description: Distance travelled by driver
        duration:
          type: integer
          description: Time spent by the driver on order
        locations:
          type: array
          description: Locations on route taken by the driver
          items:
            $ref: "#/components/schemas/TimeSeriesLocation"
      required:
        - distance
        - duration
        - locations
    EstimateResponse:
      type: object
      properties:
        start_by:
          type: string
          description: Time when driver should start the order
        distance:
          type: integer
          description: Estimated distance to be travelled by driver
        duration:
          type: integer
          description: Estimated time needed to reach destination
        polyline:
          description: Route to be taken by driver
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        start_location:
          description: Start location of the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          description: End Location of the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        arrive_at:
          type: string
          description: Time when driver should reach the destination
      required:
        - arrive_at
        - distance
        - duration
        - end_location
        - polyline
        - start_by
        - start_location
    TrackingOrder:
      type: object
      properties:
        order_handle:
          type: string
          description: Identifier of the order
        route_handle:
          type: string
          description: Route identifier
        scheduled_at:
          type: string
          nullable: true
          description: Scheduled arrival of the order
        planned_at:
          type: string
          nullable: true
          description: Time when the order was planned
        assigned_at:
          type: string
          nullable: true
          description: Time when order was assigned to a driver
        started_at:
          type: string
          nullable: true
          description: Time when the order started
        arrived_at:
          type: string
          nullable: true
          description: Time when the driver arrived at destination
        exited_at:
          type: string
          nullable: true
          description: Time when driver exited from destination
        completed_at:
          type: string
          nullable: true
          description: Time when order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Time when order was cancelled
        start_address:
          type: string
          nullable: true
          description: Start address from where order started at
        destination:
          nullable: true
          description: Destination of the order
          allOf:
            - $ref: "#/components/schemas/LocationResponse"
        summary:
          nullable: true
          description: Summary of the order
          allOf:
            - $ref: "#/components/schemas/TripSummary"
        estimate:
          nullable: true
          description: Estimate for the order
          allOf:
            - $ref: "#/components/schemas/EstimateResponse"
        status:
          type: string
          nullable: true
          description: Status of the order
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            type: object
            additionalProperties:
              nullable: true
        metadata:
          type: object
          nullable: true
          description: Metadata associated with this order
          additionalProperties:
            nullable: true
        timezone:
          type: string
          nullable: true
          description: Timezone of the order
      required:
        - order_handle
        - route_handle
    DriverLocation1:
      type: object
      properties:
        geometry:
          description: Current location of the driver
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        bearing:
          type: number
          description: Bearing of the driver
        accuracy:
          type: number
          description: Accuracy of location the driver
        speed:
          type: number
          description: Speed of the driver
        recorded_at:
          type: string
          description: Time when the location of the driver was recorded
      required:
        - accuracy
        - bearing
        - geometry
        - recorded_at
        - speed
    TrackingDriver:
      type: object
      properties:
        driver_handle:
          type: string
          description: Driver handle
        device_id:
          type: string
          description: Device id of the device of driver
        device_model:
          type: string
          description: Model of the device of driver
        name:
          type: string
          description: Name of the driver
        location:
          description: Current location of the driver
          allOf:
            - $ref: "#/components/schemas/DriverLocation1"
        status:
          type: string
          description: Status of the driver
      required:
        - device_id
        - device_model
        - driver_handle
        - location
        - name
        - status
    LocationScore:
      type: object
      properties:
        location:
          description: Location of inference
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        score:
          type: number
          default: 1
          description: The score
        timestamp:
          type: string
          format: date-time
          nullable: true
          description: Time when this score was last updated
      required:
        - location
    InferenceLocation:
      type: object
      properties:
        geometry:
          $ref: "#/components/schemas/LocationGeometryResponse"
        inferences:
          type: array
          items:
            $ref: "#/components/schemas/LocationScore"
      required:
        - geometry
        - inferences
    InferredGeofence:
      type: object
      properties:
        geometry:
          description: Location
          allOf:
            - $ref: "#/components/schemas/PolygonLocationGeometryResponse"
        source:
          enum:
            - customer_provided
            - ht_generated
          description: Source which created this location
        inclusivity:
          type: string
          description: More inclusivity means more loosely defined service area
        skew:
          type: number
          description: Skew in inferred geofence, values can be between 0 and 1. 0 mean no
            skew, i.e. perfect overlap and 1 means no overlap
        area_ratio:
          type: number
          nullable: true
          description: Ratio of inferred geometry area to current geofence area
            (inferred/current)
        centroid_shift:
          type: number
          nullable: true
          description: Distance in meters between the centroid of current geofence and
            inferred geometry
      required:
        - geometry
        - inclusivity
        - skew
        - source
    TrackingDestinationInferences:
      type: object
      properties:
        locations:
          type: array
          items:
            $ref: "#/components/schemas/InferenceLocation"
        service_area:
          type: array
          items:
            $ref: "#/components/schemas/LocationGeometryResponse"
        geofences:
          type: array
          items:
            $ref: "#/components/schemas/InferredGeofence"
      required:
        - geofences
        - locations
        - service_area
    TrackingOrderInferences:
      type: object
      properties:
        parking:
          type: array
          items:
            $ref: "#/components/schemas/LocationGeometryResponse"
        checkin:
          type: array
          items:
            $ref: "#/components/schemas/LocationGeometryResponse"
      required:
        - checkin
        - parking
    TrackingInferences:
      type: object
      properties:
        destination_inferences:
          $ref: "#/components/schemas/TrackingDestinationInferences"
        order_inferences:
          $ref: "#/components/schemas/TrackingOrderInferences"
      required:
        - destination_inferences
        - order_inferences
    TrackingResponse:
      type: object
      properties:
        order:
          description: Details of order associated with tracking id
          allOf:
            - $ref: "#/components/schemas/TrackingOrder"
        driver:
          description: Details of driver working on order
          allOf:
            - $ref: "#/components/schemas/TrackingDriver"
        inferences:
          description: inferences related to this tracking id
          allOf:
            - $ref: "#/components/schemas/TrackingInferences"
      required:
        - driver
        - inferences
        - order
    OrderExportStatusResponse:
      type: object
      properties:
        job_id:
          type: string
          description: Unique identifier for the export job
        status:
          type: string
          description: "Current status: pending, processing, completed, failed"
        rows_processed:
          type: integer
          default: 0
          description: Number of rows processed so far
        presigned_url:
          type: string
          nullable: true
          description: Presigned S3 URL to download the export (available when completed)
        error_message:
          type: string
          nullable: true
          description: Error message if job failed
        created_at:
          type: string
          nullable: true
          description: Job creation timestamp (ISO 8601)
        started_at:
          type: string
          nullable: true
          description: Job start timestamp (ISO 8601)
        completed_at:
          type: string
          nullable: true
          description: Job completion timestamp (ISO 8601)
      required:
        - job_id
        - status
    ActivityBatteryDetails:
      type: object
      properties:
        battery_used:
          type: number
          nullable: true
          description: Battery percentage used during event.
        is_battery_usage_high:
          type: boolean
          nullable: true
          description: Boolean flag indicating if battery usage during the event was high.
    DriverDevice1:
      type: object
      properties:
        device_id:
          type: string
          description: Unique ID representing the worker's device
        start_time:
          type: string
          description: Timestamp of when the device was linked to the worker
        end_time:
          type: string
          nullable: true
          description: Timestamp of when the device was unlinked to the worker
      required:
        - device_id
        - start_time
    LocationGeometryModel2:
      type: object
      properties:
        type:
          type: string
          description: Geometry type.
        coordinates:
          description: Geo coordinates (lon, lat)
          oneOf:
            - type: array
              items:
                type: number
            - type: array
              items:
                type: array
                items:
                  type: array
                  items:
                    type: number
      required:
        - coordinates
        - type
    ActivityDetail2:
      type: object
      properties:
        steps:
          type: integer
          nullable: true
          description: Number of steps
        distance:
          type: integer
          nullable: true
          description: Distance in metres
        duration:
          type: integer
          nullable: true
          description: Duration in seconds
    PolylineGeometry2:
      type: object
      properties:
        type:
          type: string
          description: geometry type
        coordinates:
          type: array
          nullable: true
          description: "centre coordinates: lon, lat"
          items:
            type: array
            items:
              type: number
      required:
        - type
    PolylineProperties2:
      type: object
      properties:
        timestamps:
          type: array
          nullable: true
          description: list of timestamps, one for each location in polyline.
          items:
            type: string
    PolylineGeoJSON2:
      type: object
      properties:
        type:
          type: string
          description: type
        geometry:
          description: geojson geometry
          allOf:
            - $ref: "#/components/schemas/PolylineGeometry2"
        properties:
          description: geojson properties
          allOf:
            - $ref: "#/components/schemas/PolylineProperties2"
      required:
        - geometry
        - properties
        - type
    ActivityBatteryDetails1:
      type: object
      properties:
        battery_used:
          type: number
          nullable: true
          description: Battery percentage used during event.
        is_battery_usage_high:
          type: boolean
          nullable: true
          description: Boolean flag indicating if battery usage during the event was high.
    DriverActivityEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_activity_event
          description: String indicating the type of timeline event.
        recorded_at_start:
          type: string
          nullable: true
          description: Timestamp indicating the beginning of the event.
        recorded_at_end:
          type: string
          nullable: true
          description: Timestamp indicating the end of the event
        location_start:
          nullable: true
          description: Location of the device at the beginning of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel2"
        location_end:
          nullable: true
          description: Location of the device at the end of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        detail:
          nullable: true
          description: Details of activity ex. distance (metres), duration (seconds),
            steps (number)
          allOf:
            - $ref: "#/components/schemas/ActivityDetail2"
        activity:
          type: string
          nullable: true
          description: "type of activity: drive/stop/walk"
        marker_id:
          type: string
          nullable: true
          description: event id
        split_marker_id:
          type: string
          nullable: true
          description: marker id if the marker is split
        is_partial:
          type: boolean
          description: flag indicating if the activity is trimmed.
        is_ongoing:
          type: boolean
          description: flag indicating if the activity is ongoing.
        polyline:
          nullable: true
          description: polyline associated with the activity
          allOf:
            - $ref: "#/components/schemas/PolylineGeoJSON2"
        address:
          type: string
          nullable: true
          description: address associated with activity
        source_locations:
          type: string
          writeOnly: true
          nullable: true
          description: source locations
        hex_map:
          type: array
          nullable: true
          description: location heatmap for stop activity
          items:
            $ref: "#/components/schemas/PolygonHeatMap"
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
        battery_details:
          nullable: true
          description: Details of battery usage during the event.
          allOf:
            - $ref: "#/components/schemas/ActivityBatteryDetails1"
      required:
        - is_ongoing
        - is_partial
        - type
    DriverOutageEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_outage_event
          description: String indicating the type of timeline event.
        recorded_at_start:
          type: string
          nullable: true
          description: Timestamp indicating the beginning of the event.
        recorded_at_end:
          type: string
          nullable: true
          description: Timestamp indicating the end of the event
        location_start:
          nullable: true
          description: Location of the device at the beginning of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_end:
          nullable: true
          description: Location of the device at the end of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        marker_id:
          type: string
          nullable: true
          description: unique id
        split_marker_id:
          type: string
          nullable: true
          description: marker id if the marker is split
        outage_code:
          type: string
          description: Code indicating the type of outage
        outage_label:
          type: string
          description: Text indicating the type of outage
        outage_is_user_generated:
          type: boolean
          description: Flag indicating if the outage is user generated.
        outage_description:
          type: string
          description: Text describing the outage and resolution.
        outage_category:
          type: string
          enum:
            - behavioural
            - adversarial
            - reachability
            - os
            - sporadic
          description: String indicating the category of outage
        detail:
          nullable: true
          description: "Details associated with outage: distance/duration etc."
          allOf:
            - $ref: "#/components/schemas/ActivityDetail"
        is_partial:
          type: boolean
          description: flag indicating if the outage is partial.
        is_ongoing:
          type: boolean
          description: flag indicating if the activity is ongoing.
        polyline:
          nullable: true
          description: estimated polyline associated with the outage
          allOf:
            - $ref: "#/components/schemas/PolylineGeoJSON"
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
      required:
        - is_ongoing
        - is_partial
        - outage_category
        - outage_code
        - outage_description
        - outage_is_user_generated
        - outage_label
        - type
    StatusDetail2:
      type: object
      properties:
        actor:
          enum:
            - business
            - hypertrack
          nullable: true
          description: Source of the action that updated the status.
    DriverStatusUpdatedEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_status_updated
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        detail:
          nullable: true
          description: Details of the status update.
          allOf:
            - $ref: "#/components/schemas/StatusDetail2"
        tracking:
          type: boolean
          nullable: true
          description: Boolean flag indicating tracking status.
        available:
          type: boolean
          nullable: true
          description: Boolean flag indicating availability status.
        marker_id:
          type: string
          nullable: true
          description: unique id
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
      required:
        - type
    ImageAttachment3:
      type: object
      properties:
        type:
          enum:
            - image
          description: Type of attachment
        url:
          type: string
          description: Image link
        caption:
          type: string
          nullable: true
          description: Caption for the image
      required:
        - type
        - url
    NoteAttachment3:
      type: object
      properties:
        type:
          enum:
            - note
          description: Type of attachment
        data:
          type: string
          description: Text for the note
      required:
        - data
        - type
    SignatureAttachment3:
      type: object
      properties:
        type:
          enum:
            - signature
          description: Type of attachment
        url:
          type: string
          description: Signature image link
      required:
        - type
        - url
    GeotagEvent1:
      type: object
      properties:
        type:
          type: string
          enum:
            - geotag_event
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        geotag_id:
          type: string
          nullable: true
          description: id of geotag
        address:
          type: string
          nullable: true
          description: Address of the device when the geotag was created.
        order_handle:
          type: string
          nullable: true
          description: Order handle associated with the geotag.
        metadata:
          type: object
          nullable: true
          description: metadata of geotag
          additionalProperties:
            nullable: true
        geotag_type:
          type: string
          nullable: true
          description: Type of geotag.
        deviation:
          type: integer
          nullable: true
          description: Deviation of geotag.
        expected_location:
          nullable: true
          description: Expected Location.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        place_handle:
          type: string
          nullable: true
          description: handle of the place
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
        accuracy:
          type: integer
          nullable: true
          description: Error margin of location reading associated with the geotag
        attachments:
          type: array
          nullable: true
          description: Attachments associated with the event
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment3"
              - $ref: "#/components/schemas/NoteAttachment3"
              - $ref: "#/components/schemas/SignatureAttachment3"
      required:
        - type
    OrderAssignedEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_assigned
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
      required:
        - type
    OrderStartedEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_started
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
      required:
        - type
    OrderCompletedEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_completed
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
      required:
        - type
    OrderCancelledEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_cancelled
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
      required:
        - type
    OrderRescheduledEvent:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_order_rescheduled
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          nullable: true
          description: Timestamp when the event was recorded
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        order_handle:
          type: string
          nullable: true
          description: Order handle
        route_handle:
          type: string
          nullable: true
          description: Route handle
        order_type:
          type: string
          nullable: true
          description: Order type
        destination_address:
          type: string
          nullable: true
          description: Address of the intended order destination.
        destination_location:
          nullable: true
          description: Intended order destination in coordinates.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number of fulfillment attempts made.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
      required:
        - type
    GeofenceGeometry1:
      type: object
      properties:
        type:
          type: string
          description: type
        geometry:
          description: geometry of geofence
          oneOf:
            - $ref: "#/components/schemas/PointGeometry"
            - $ref: "#/components/schemas/PolylineGeometry"
        properties:
          type: object
          nullable: true
          description: properties
          additionalProperties:
            nullable: true
      required:
        - geometry
        - type
    DriverVisitEvent1:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_visit_event
          description: String indicating the type of timeline event.
        recorded_at_start:
          type: string
          nullable: true
          description: Timestamp indicating the beginning of the event.
        recorded_at_end:
          type: string
          nullable: true
          description: Timestamp indicating the end of the event
        location_start:
          nullable: true
          description: Location of the device at the beginning of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_end:
          nullable: true
          description: Location of the device at the end of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        marker_id:
          type: string
          nullable: true
          description: unique id
        geofence_id:
          type: string
          description: ID of the visited geofence.
        geofence_label:
          type: string
          nullable: true
          description: Name of the visited geofence.
        geofence_geometry:
          nullable: true
          description: Geometry of the visited geofence in geojson format
          allOf:
            - $ref: "#/components/schemas/GeofenceGeometry1"
        geofence_metadata:
          type: object
          nullable: true
          description: metadata of geofence
          additionalProperties:
            nullable: true
        address:
          type: string
          nullable: true
          description: Human friendly address of the visit.
        duration:
          type: integer
          nullable: true
          description: Duration of visit in seconds.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          nullable: true
          description: Unique ID of device
        order_handle:
          type: string
          nullable: true
          description: Unique handle of the order
        enroute_distance:
          type: integer
          nullable: true
          description: Distance travelled on route to the visit
        enroute_duration:
          type: integer
          nullable: true
          description: Duration spent on route to visit
      required:
        - geofence_id
        - type
    DeviceInfo2:
      type: object
      properties:
        timezone:
          type: string
          description: Timezone of the device
        os_name:
          type: string
          description: Operating system running on the device
        device_brand:
          type: string
          description: Brand of the device
        sdk_version:
          type: string
          description: HyperTrack SDK version used on the device
        device_model:
          type: string
          description: Model of the device
        network_operator:
          type: string
          nullable: true
          description: Network operator used by the device
        os_version:
          type: string
          description: Operating system version on the device
        os_hardware_identifier:
          type: string
          description: Hardware identification number for the device
        app_name:
          type: string
          description: App name on the device
        app_version_string:
          type: string
          nullable: true
          description: App version used on the device
        app_version_number:
          type: string
          nullable: true
          description: App version number used on the device
      required:
        - app_name
        - device_brand
        - device_model
        - os_hardware_identifier
        - os_name
        - os_version
        - sdk_version
        - timezone
    DriverDeviceLinkedEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_device_linked_event
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          description: Timestamp indicating the beginning of the device session.
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_recorded_at:
          type: string
          nullable: true
          description: Timestamp when the location was recorded.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          description: Unique ID of device
        device_info:
          nullable: true
          description: Device information
          allOf:
            - $ref: "#/components/schemas/DeviceInfo2"
        former_associated_workers:
          type: array
          nullable: true
          description: List of workers connected to this device in the last 2 days
          items:
            nullable: true
      required:
        - device_id
        - recorded_at
        - type
    DriverDeviceUnlinkedEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - driver_device_unlinked_event
          description: String indicating the type of timeline event.
        recorded_at:
          type: string
          description: Timestamp indicating the end of the device session.
        location:
          nullable: true
          description: Location of the device when the event was recorded
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_recorded_at:
          type: string
          nullable: true
          description: Timestamp when the location was recorded.
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          description: Unique ID of device
        device_info:
          nullable: true
          description: Device information
          allOf:
            - $ref: "#/components/schemas/DeviceInfo"
        unlink_duration:
          type: integer
          nullable: true
          description: Duration in seconds indicating how long the worker remained
            unlinked from the device.
        unlinked_due_to_logout:
          type: boolean
          nullable: true
          description: Flag indicating whether the device was unlinked as a result of a
            logout event.
      required:
        - device_id
        - recorded_at
        - type
    DeviceDisconnectedEvent2:
      type: object
      properties:
        type:
          type: string
          enum:
            - device_disconnected_event
          description: String indicating the type of timeline event.
        recorded_at_start:
          type: string
          nullable: true
          description: Timestamp indicating the beginning of the event.
        recorded_at_end:
          type: string
          nullable: true
          description: Timestamp indicating the end of the event
        location_start:
          nullable: true
          description: Location of the device at the beginning of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        location_end:
          nullable: true
          description: Location of the device at the end of the event.
          allOf:
            - $ref: "#/components/schemas/LocationGeometryModel"
        driver_handle:
          type: string
          nullable: true
          deprecated: true
          description: handle of the driver
        worker_handle:
          type: string
          nullable: true
          description: handle of the worker
        device_id:
          type: string
          description: Unique ID of device
        marker_id:
          type: string
          nullable: true
          description: unique id
        split_marker_id:
          type: string
          nullable: true
          description: marker id if the marker is split
        disconnected_code:
          type: string
          description: Code indicating the type of event
        disconnected_label:
          type: string
          description: Text indicating the type of event
        disconnected_description:
          type: string
          description: Text describing the detail description.
        detail:
          nullable: true
          description: "Details associated with stats: distance/duration etc."
          allOf:
            - $ref: "#/components/schemas/ActivityDetail"
        is_partial:
          type: boolean
          description: flag indicating if the outage is partial.
        is_ongoing:
          type: boolean
          description: flag indicating if the activity is ongoing.
      required:
        - device_id
        - disconnected_code
        - disconnected_description
        - disconnected_label
        - is_ongoing
        - is_partial
        - type
    GetWorkerTimelineResponse:
      type: object
      properties:
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker
        name:
          type: string
          nullable: true
          description: Name of the worker
        current_date:
          type: string
          description: Current date in the timezone of the worker.
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group to which the worker belongs
        product_types:
          type: array
          nullable: true
          description: List of product types used for worker matching during order planning
          items:
            type: string
        device_id:
          type: string
          nullable: true
          description: Unique ID representing the worker's device
        device_info:
          nullable: true
          description: Information of the Device associated with worker
          allOf:
            - $ref: "#/components/schemas/DeviceInfo"
        profile:
          type: object
          nullable: true
          description: Metadata associated with a worker
          additionalProperties:
            nullable: true
        work_status:
          description: work_status of the worker with respect to availability and on order
            fulfilment
          allOf:
            - $ref: "#/components/schemas/DriverStatus1"
        schedule:
          type: array
          nullable: true
          description: List indicating the schedule of a worker for work assignment
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverDateSchedule"
              - $ref: "#/components/schemas/DriverRecurringSchedule"
        deleted:
          type: boolean
          nullable: true
          description: Flag indicating whether the worker was deleted
        created_at:
          type: string
          description: Timestamp at which the worker was created
        home:
          nullable: true
          description: Worker home
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadiusResponse"
        deleted_at:
          type: string
          nullable: true
          description: Timestamp at which the worker was deleted
        location:
          nullable: true
          description: Last known location of the worker
          allOf:
            - $ref: "#/components/schemas/MovementLocationResponse"
        device_status:
          nullable: true
          description: Current status of the device used by the worker
          allOf:
            - $ref: "#/components/schemas/DeviceStatus1"
        unavailable_on:
          type: array
          nullable: true
          description: List of dates (YYYY-MM-DD) on which the worker is not available
          items:
            type: string
        devices:
          type: array
          nullable: true
          description: List of devices that were linked to the worker
          items:
            $ref: "#/components/schemas/DriverDevice1"
        summary:
          nullable: true
          description: Summary of work for the worker
          allOf:
            - $ref: "#/components/schemas/DriverSummary1"
        location_permission:
          nullable: true
          description: Last known location permission on the worker's device
          allOf:
            - $ref: "#/components/schemas/LocationPermission1"
        timeline:
          type: array
          nullable: true
          description: Worker timeline events highlighting the work and relevant events
            during specified time range.
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverActivityEvent2"
              - $ref: "#/components/schemas/DriverOutageEvent2"
              - $ref: "#/components/schemas/DriverStatusUpdatedEvent2"
              - $ref: "#/components/schemas/GeotagEvent1"
              - $ref: "#/components/schemas/OrderAssignedEvent2"
              - $ref: "#/components/schemas/OrderStartedEvent2"
              - $ref: "#/components/schemas/OrderCompletedEvent2"
              - $ref: "#/components/schemas/OrderCancelledEvent2"
              - $ref: "#/components/schemas/OrderRescheduledEvent"
              - $ref: "#/components/schemas/DriverVisitEvent1"
              - $ref: "#/components/schemas/DriverDeviceLinkedEvent2"
              - $ref: "#/components/schemas/DriverDeviceUnlinkedEvent2"
              - $ref: "#/components/schemas/DeviceDisconnectedEvent2"
        battery:
          nullable: true
          description: Information of the battery status
          allOf:
            - $ref: "#/components/schemas/BatteryStatus1"
        timezone:
          type: string
          default: UTC
          nullable: true
          description: Timezone of the worker
      required:
        - created_at
        - current_date
        - ops_group_handle
        - work_status
        - worker_handle
    PatchWorkerRequest:
      type: object
      properties:
        device_id:
          type: string
          format: uuid
          nullable: true
          description: Unique ID representing the worker's device
        name:
          type: string
          nullable: true
          description: Name of the worker
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for an Ops Group to which the worker belongs
        home:
          nullable: true
          description: Worker's home location
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadius1"
        product_types:
          type: array
          nullable: true
          description: List of product types used for worker matching during order planning
          items:
            type: string
        schedule:
          type: array
          nullable: true
          description: List of schedules used for worker matching during order planning
            and auto start/stop of availability or tracking of the worker
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverDateSchedule"
              - $ref: "#/components/schemas/DriverRecurringSchedule"
        profile:
          type: object
          nullable: true
          description: Additional customer provided data associated with a worker
          additionalProperties:
            nullable: true
        unavailable_on:
          type: array
          nullable: true
          description: List of dates (YYYY-MM-DD) on which the worker is unavailable
          items:
            type: string
        transfer_existing_work:
          type: boolean
          default: true
          nullable: true
          description: Flag to indicate whether existing work of the worker is to be
            transferred to the newly linked device.Only applicable at the time
            of linking worker with a device.
    PatchWorkerResponse:
      type: object
      properties:
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker
        name:
          type: string
          nullable: true
          description: Name of the worker
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group to which the worker belongs
        product_types:
          type: array
          description: List of product types used for worker matching during order planning
          items:
            type: string
        device_id:
          type: string
          nullable: true
          description: Unique ID representing the worker's device
        profile:
          type: object
          description: Metadata associated with a worker
          additionalProperties:
            nullable: true
        work_status:
          description: work_status of the worker with respect to availability and on order
            fulfilment
          allOf:
            - $ref: "#/components/schemas/DriverStatus1"
        schedule:
          type: array
          nullable: true
          description: List indicating the schedule of a worker for work assignment
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverDateSchedule"
              - $ref: "#/components/schemas/DriverRecurringSchedule"
        deleted:
          type: boolean
          nullable: true
          description: Flag indicating whether the worker was deleted
        created_at:
          type: string
          description: Timestamp at which the worker was created
        home:
          description: Worker home
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadiusResponse"
        deleted_at:
          type: string
          nullable: true
          description: Timestamp at which the worker was deleted
        location:
          nullable: true
          description: Last known location of the worker.
          allOf:
            - $ref: "#/components/schemas/MovementLocationResponse"
        device_status:
          nullable: true
          description: Current status of the device used by the worker
          allOf:
            - $ref: "#/components/schemas/DeviceStatus1"
        unavailable_on:
          type: array
          description: List of dates (YYYY-MM-DD) on which the worker is not available
          items:
            type: string
        summary:
          nullable: true
          description: Summary of work done by the worker during the specified time range.
            Default last 24 hours.
          allOf:
            - $ref: "#/components/schemas/DriverSummary1"
        location_permission:
          nullable: true
          description: Last known location permission on the worker's device
          allOf:
            - $ref: "#/components/schemas/LocationPermission1"
        device_info:
          nullable: true
          description: Information of the Device associated with Worker
          allOf:
            - $ref: "#/components/schemas/DeviceInfo"
        battery:
          nullable: true
          description: Information of the battery status.
          allOf:
            - $ref: "#/components/schemas/BatteryStatus1"
        timezone:
          type: string
          nullable: true
          description: Timezone of the worker
      required:
        - created_at
        - home
        - ops_group_handle
        - product_types
        - profile
        - unavailable_on
        - work_status
        - worker_handle
    WorkerExportStatusResponse:
      type: object
      properties:
        job_id:
          type: string
          description: Unique identifier for the export job
        status:
          type: string
          description: "Current status: pending, processing, completed, failed"
        rows_processed:
          type: integer
          default: 0
          description: Number of rows processed so far
        presigned_url:
          type: string
          nullable: true
          description: Presigned S3 URL to download the export (available when completed)
        error_message:
          type: string
          nullable: true
          description: Error message if job failed
        created_at:
          type: string
          nullable: true
          description: Job creation timestamp (ISO 8601)
        started_at:
          type: string
          nullable: true
          description: Job start timestamp (ISO 8601)
        completed_at:
          type: string
          nullable: true
          description: Job completion timestamp (ISO 8601)
      required:
        - job_id
        - status
    GetGeotagTimelineResponse:
      type: object
      properties:
        geotag_id:
          type: string
          format: uuid
          description: Unique ID to identify a geotag
        driver_handle:
          type: string
          description: String representing the handle for the driver
          deprecated: true
        worker_handle:
          type: string
          description: String representing the handle for the worker
        recorded_at:
          type: string
          description: ISO 8601 date when the geotag was created
        device_id:
          type: string
          format: uuid
          description: String representing the ID of the device
        metadata:
          type: object
          description: Optional metadata associated with the geotag
          additionalProperties:
            nullable: true
        location:
          description: Geometry location for a geotag
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadius"
        place_handle:
          type: string
          description: String representing the handle for the worker
        expected_location:
          description: Expected Geometry location for a geotag
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadius"
        start_location:
          description: Starting Geometry location point for a geotag
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadius"
        region:
          description: Region for a geotag
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          description: Distance from the tracking start for the geotag
        duration:
          type: integer
          description: Time taken from start location to this geotag location
        deviation:
          type: integer
          description: Haversine deviation in meters from the expected location
        tracking_rate:
          type: number
          description: Driver tracking rate during the lifespan of the geotag
        geotag_type:
          type: string
          description: String representing type of Geotag
        order_handle:
          type: string
          description: String representing order handle with which the geotag is associated
        driver_name:
          type: string
          description: String representing the name of the driver
        ops_group_handle:
          type: string
          description: String representing the ops group handle
        system_generated_order_handle:
          type: boolean
          description: Boolean representing whether the handle was automatically generated
            by HT system or not
        timezone:
          type: string
          nullable: true
          description: Timezone associated with this geotag
        attachments:
          type: array
          nullable: true
          description: Attachments associated with this geotag
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        tracking_summary:
          nullable: true
          description: Tracking summary of activities during the lifespan of geotag
          allOf:
            - $ref: "#/components/schemas/GeotagTrackingSummary"
      required:
        - device_id
        - geotag_id
        - location
        - recorded_at
    TasksDefinitionResponse:
      type: object
      properties:
        label:
          type: string
          description: Name of the task definition.
        ops_group_handle:
          type: string
          nullable: true
          description: Ops group associated with this definition
        tasks:
          type: array
          description: List of tasks part of this definition.
          items:
            $ref: "#/components/schemas/BaseOrderTask"
        metadata:
          type: object
          nullable: true
          description: Additional metadata for this definition.
          additionalProperties:
            nullable: true
        task_definition_id:
          type: string
          description: Unique identifier for the task definition.
        created_at:
          type: string
          description: Timestamp when the task definition was created.
        updated_at:
          type: string
          nullable: true
          description: Timestamp when the task definition was last updated.
      required:
        - created_at
        - label
        - task_definition_id
        - tasks
    TasksDefinitionListResponse:
      type: object
      properties:
        task_definitions:
          type: array
          description: List of task definitions available in the system.
          items:
            $ref: "#/components/schemas/TasksDefinitionResponse"
        pagination_token:
          type: string
          nullable: true
          description: Token for pagination, used to fetch the next set of results.
      required:
        - task_definitions
    CreateTasksDefinitionRequest:
      type: object
      properties:
        label:
          type: string
          description: Name of the task definition.
        ops_group_handle:
          type: string
          nullable: true
          description: Ops group associated with this definition
        tasks:
          type: array
          description: List of tasks part of this definition.
          items:
            $ref: "#/components/schemas/BaseOrderTask"
        metadata:
          type: object
          nullable: true
          description: Additional metadata for this definition.
          additionalProperties:
            nullable: true
      required:
        - label
        - tasks
    OrderTaskListResponse:
      type: object
      properties:
        tasks:
          type: array
          description: List of tasks associated with the order.
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
      required:
        - tasks
    CreateOrderTasksRequest:
      type: object
      properties:
        tasks:
          type: array
          description: List of task types to be created for the order. Valid values are
            'order_summary' and 'order_billing_summary'.
          items:
            $ref: "#/components/schemas/BaseOrderTask"
      required:
        - tasks
    CreateOrderTasksResponse:
      type: object
      properties:
        tasks:
          type: array
          description: List of tasks created for the order.
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
      required:
        - tasks
    CustomOrderEvent:
      type: object
      properties:
        type:
          type: string
          maxLength: 64
          description: Name of event
        recorded_at:
          type: string
          description: Timestamp of when the event occurred
        metadata:
          type: object
          nullable: true
          description: Any additional metadata to associate with the event
          additionalProperties:
            nullable: true
        location:
          nullable: true
          description: Location where the event occurred
          allOf:
            - $ref: "#/components/schemas/PointLocation1"
        address:
          type: string
          nullable: true
          description: Address of the location where the event occurred
        attachments:
          type: array
          nullable: true
          minItems: 1
          maxItems: 10
          description: List of attachments in event
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment"
              - $ref: "#/components/schemas/NoteAttachment"
              - $ref: "#/components/schemas/SignatureAttachment"
      required:
        - recorded_at
        - type
    CustomOrderEventRequest:
      type: object
      properties:
        events:
          type: array
          minItems: 1
          maxItems: 100
          description: List of order events
          items:
            $ref: "#/components/schemas/CustomOrderEvent"
      required:
        - events
    CancelOrderRequest:
      type: object
      properties: {}
    CancelOrderResponse:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        created_by:
          nullable: true
          description: Who created the order
          allOf:
            - $ref: "#/components/schemas/Source"
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        destination:
          nullable: true
          description: Destination for the order
          oneOf:
            - $ref: "#/components/schemas/OrderDetailPointDestination"
            - $ref: "#/components/schemas/OrderDetailPolygonDestination"
            - $ref: "#/components/schemas/OrderDetailGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderDetailPlaceHandleDestination"
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the order is associated
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the order was planned - `manual`, `scheduled`
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          description: Timestamp at which the order was cancelled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderDetailEstimate"
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify if the order is a pick/drop
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        plan_id:
          type: string
          nullable: true
          description: Unique identifier of the plan
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the order is tracked in flex, on_time,
            on_shift, full_shift or pre_shift mode
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Total time tracked in seconds for the driver at the location when
            fulfilling the order
        polyline:
          nullable: true
          description: GeoJSON representation of polyline with the coordinates of the
            actual path travelled by the driver
          allOf:
            - $ref: "#/components/schemas/Polyline"
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
        cancelled_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was cancelled at destination
        visited_destination:
          type: boolean
          nullable: true
          description: Indicates whether the driver visited the destination
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the order
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking once the order was
            fulfilled or cancelled
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        images:
          type: array
          nullable: true
          description: List of URLs to be used to retrieve images associated with the order
          items:
            type: string
        order_score:
          type: number
          nullable: true
          description: ""
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        previous_fulfillments:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/FulfillmentAttempt"
        parking:
          type: array
          nullable: true
          description: Parkings associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderParkingResponse"
        checkin:
          type: array
          nullable: true
          description: Checkins associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderCheckinResponse"
        service_area:
          type: array
          nullable: true
          description: Service Areas associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderServiceAreaResponse"
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first location after device's tracking
            is initiated for the route
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first event after device's tracking is
            initiated for the route
        timeline:
          type: array
          nullable: true
          description: New Order timeline events sorted by event time
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverActivityEvent"
              - $ref: "#/components/schemas/DriverOutageEvent"
              - $ref: "#/components/schemas/DriverStatusUpdatedEvent"
              - $ref: "#/components/schemas/OrderCreatedEvent"
              - $ref: "#/components/schemas/OrderAssignedEvent"
              - $ref: "#/components/schemas/OrderStartedEvent"
              - $ref: "#/components/schemas/OrderCompletedEvent"
              - $ref: "#/components/schemas/OrderCancelledEvent"
              - $ref: "#/components/schemas/OrderEnterExitEvent"
              - $ref: "#/components/schemas/OrderInferredEvent"
              - $ref: "#/components/schemas/OrderCustomEvent"
              - $ref: "#/components/schemas/OrderServiceEvent"
              - $ref: "#/components/schemas/DriverDeviceLinkedEvent"
              - $ref: "#/components/schemas/DriverDeviceUnlinkedEvent"
              - $ref: "#/components/schemas/DeviceDisconnectedEvent"
        worker_name:
          type: string
          nullable: true
          description: Name of the worker to whom order is assigned.
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which order is expected to switch device
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        billing_details:
          nullable: true
          description: Billing details for the order.
          allOf:
            - $ref: "#/components/schemas/OrderBillingDetails"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order
        tasks:
          type: array
          nullable: true
          description: tasks associated with the order
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
        metrics:
          nullable: true
          description: Metrics associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderMetrics"
        timesheets:
          type: array
          nullable: true
          description: Timesheet entries for the order. Includes HyperTrack-computed
            (HypertrackLocationTimesheet) and customer-provided entries.
          items:
            oneOf:
              - $ref: "#/components/schemas/HypertrackLocationTimesheet"
              - type: object
                additionalProperties:
                  nullable: true
        agent:
          nullable: true
          description: Closeout copilot review data. Contains a `status` field (e.g.
            "approved") and a `timesheets` list of agent-collected or
            agent-reconciled entries. Null when closeout is not enabled or no
            review has taken place.
          allOf:
            - $ref: "#/components/schemas/AgentReview"
      required:
        - cancelled_at
        - order_handle
        - status
    EnableOrderRequest:
      type: object
      properties: {}
    EnableOrderResponse:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        created_by:
          nullable: true
          description: Who created the order
          allOf:
            - $ref: "#/components/schemas/Source"
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        destination:
          nullable: true
          description: Destination for the order
          oneOf:
            - $ref: "#/components/schemas/OrderDetailPointDestination"
            - $ref: "#/components/schemas/OrderDetailPolygonDestination"
            - $ref: "#/components/schemas/OrderDetailGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderDetailPlaceHandleDestination"
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the order is associated
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the order was planned - `manual`, `scheduled`
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderDetailEstimate"
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify if the order is a pick/drop
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        plan_id:
          type: string
          nullable: true
          description: Unique identifier of the plan
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the order is tracked in flex, on_time,
            on_shift, full_shift or pre_shift mode
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Total time tracked in seconds for the driver at the location when
            fulfilling the order
        polyline:
          nullable: true
          description: GeoJSON representation of polyline with the coordinates of the
            actual path travelled by the driver
          allOf:
            - $ref: "#/components/schemas/Polyline"
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
        cancelled_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was cancelled at destination
        visited_destination:
          type: boolean
          nullable: true
          description: Indicates whether the driver visited the destination
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the order
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking once the order was
            fulfilled or cancelled
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        images:
          type: array
          nullable: true
          description: List of URLs to be used to retrieve images associated with the order
          items:
            type: string
        order_score:
          type: number
          nullable: true
          description: ""
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        previous_fulfillments:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/FulfillmentAttempt"
        parking:
          type: array
          nullable: true
          description: Parkings associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderParkingResponse"
        checkin:
          type: array
          nullable: true
          description: Checkins associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderCheckinResponse"
        service_area:
          type: array
          nullable: true
          description: Service Areas associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderServiceAreaResponse"
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first location after device's tracking
            is initiated for the route
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first event after device's tracking is
            initiated for the route
        timeline:
          type: array
          nullable: true
          description: New Order timeline events sorted by event time
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverActivityEvent"
              - $ref: "#/components/schemas/DriverOutageEvent"
              - $ref: "#/components/schemas/DriverStatusUpdatedEvent"
              - $ref: "#/components/schemas/OrderCreatedEvent"
              - $ref: "#/components/schemas/OrderAssignedEvent"
              - $ref: "#/components/schemas/OrderStartedEvent"
              - $ref: "#/components/schemas/OrderCompletedEvent"
              - $ref: "#/components/schemas/OrderCancelledEvent"
              - $ref: "#/components/schemas/OrderEnterExitEvent"
              - $ref: "#/components/schemas/OrderInferredEvent"
              - $ref: "#/components/schemas/OrderCustomEvent"
              - $ref: "#/components/schemas/OrderServiceEvent"
              - $ref: "#/components/schemas/DriverDeviceLinkedEvent"
              - $ref: "#/components/schemas/DriverDeviceUnlinkedEvent"
              - $ref: "#/components/schemas/DeviceDisconnectedEvent"
        worker_name:
          type: string
          nullable: true
          description: Name of the worker to whom order is assigned.
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which order is expected to switch device
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        billing_details:
          nullable: true
          description: Billing details for the order.
          allOf:
            - $ref: "#/components/schemas/OrderBillingDetails"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order
        tasks:
          type: array
          nullable: true
          description: tasks associated with the order
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
        metrics:
          nullable: true
          description: Metrics associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderMetrics"
        timesheets:
          type: array
          nullable: true
          description: Timesheet entries for the order. Includes HyperTrack-computed
            (HypertrackLocationTimesheet) and customer-provided entries.
          items:
            oneOf:
              - $ref: "#/components/schemas/HypertrackLocationTimesheet"
              - type: object
                additionalProperties:
                  nullable: true
        agent:
          nullable: true
          description: Closeout copilot review data. Contains a `status` field (e.g.
            "approved") and a `timesheets` list of agent-collected or
            agent-reconciled entries. Null when closeout is not enabled or no
            review has taken place.
          allOf:
            - $ref: "#/components/schemas/AgentReview"
      required:
        - enabled_at
        - order_handle
        - status
    GetOrdersByRouteHandleResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    PatchRouteRequest:
      type: object
      properties:
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        scheduled_start_at:
          type: string
          format: date-time
          nullable: true
          description: Scheduled start time of the route
    PatchRouteResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    DisableOrderRequest:
      type: object
      properties: {}
    DisableOrderResponse:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        created_by:
          nullable: true
          description: Who created the order
          allOf:
            - $ref: "#/components/schemas/Source"
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        destination:
          nullable: true
          description: Destination for the order
          oneOf:
            - $ref: "#/components/schemas/OrderDetailPointDestination"
            - $ref: "#/components/schemas/OrderDetailPolygonDestination"
            - $ref: "#/components/schemas/OrderDetailGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderDetailPlaceHandleDestination"
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the order is associated
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the order was planned - `manual`, `scheduled`
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
        disabled_at:
          type: string
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderDetailEstimate"
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify if the order is a pick/drop
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        plan_id:
          type: string
          nullable: true
          description: Unique identifier of the plan
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the order is tracked in flex, on_time,
            on_shift, full_shift or pre_shift mode
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Total time tracked in seconds for the driver at the location when
            fulfilling the order
        polyline:
          nullable: true
          description: GeoJSON representation of polyline with the coordinates of the
            actual path travelled by the driver
          allOf:
            - $ref: "#/components/schemas/Polyline"
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
        cancelled_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was cancelled at destination
        visited_destination:
          type: boolean
          nullable: true
          description: Indicates whether the driver visited the destination
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the order
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking once the order was
            fulfilled or cancelled
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        images:
          type: array
          nullable: true
          description: List of URLs to be used to retrieve images associated with the order
          items:
            type: string
        order_score:
          type: number
          nullable: true
          description: ""
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        previous_fulfillments:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/FulfillmentAttempt"
        parking:
          type: array
          nullable: true
          description: Parkings associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderParkingResponse"
        checkin:
          type: array
          nullable: true
          description: Checkins associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderCheckinResponse"
        service_area:
          type: array
          nullable: true
          description: Service Areas associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderServiceAreaResponse"
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first location after device's tracking
            is initiated for the route
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first event after device's tracking is
            initiated for the route
        timeline:
          type: array
          nullable: true
          description: New Order timeline events sorted by event time
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverActivityEvent"
              - $ref: "#/components/schemas/DriverOutageEvent"
              - $ref: "#/components/schemas/DriverStatusUpdatedEvent"
              - $ref: "#/components/schemas/OrderCreatedEvent"
              - $ref: "#/components/schemas/OrderAssignedEvent"
              - $ref: "#/components/schemas/OrderStartedEvent"
              - $ref: "#/components/schemas/OrderCompletedEvent"
              - $ref: "#/components/schemas/OrderCancelledEvent"
              - $ref: "#/components/schemas/OrderEnterExitEvent"
              - $ref: "#/components/schemas/OrderInferredEvent"
              - $ref: "#/components/schemas/OrderCustomEvent"
              - $ref: "#/components/schemas/OrderServiceEvent"
              - $ref: "#/components/schemas/DriverDeviceLinkedEvent"
              - $ref: "#/components/schemas/DriverDeviceUnlinkedEvent"
              - $ref: "#/components/schemas/DeviceDisconnectedEvent"
        worker_name:
          type: string
          nullable: true
          description: Name of the worker to whom order is assigned.
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which order is expected to switch device
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        billing_details:
          nullable: true
          description: Billing details for the order.
          allOf:
            - $ref: "#/components/schemas/OrderBillingDetails"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order
        tasks:
          type: array
          nullable: true
          description: tasks associated with the order
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
        metrics:
          nullable: true
          description: Metrics associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderMetrics"
        timesheets:
          type: array
          nullable: true
          description: Timesheet entries for the order. Includes HyperTrack-computed
            (HypertrackLocationTimesheet) and customer-provided entries.
          items:
            oneOf:
              - $ref: "#/components/schemas/HypertrackLocationTimesheet"
              - type: object
                additionalProperties:
                  nullable: true
        agent:
          nullable: true
          description: Closeout copilot review data. Contains a `status` field (e.g.
            "approved") and a `timesheets` list of agent-collected or
            agent-reconciled entries. Null when closeout is not enabled or no
            review has taken place.
          allOf:
            - $ref: "#/components/schemas/AgentReview"
      required:
        - disabled_at
        - order_handle
        - status
    AddAttachmentRequest:
      type: object
      properties:
        attachments:
          type: array
          nullable: true
          minItems: 1
          maxItems: 10
          description: List of attachments in event
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment"
              - $ref: "#/components/schemas/NoteAttachment"
              - $ref: "#/components/schemas/SignatureAttachment"
    AddAttachmentResponse:
      type: object
      properties:
        visit_id:
          type: string
          format: uuid
          description: Unique identifier representing each visit.
        created_at:
          type: string
          description: Creation timestamp of visit
        updated_at:
          type: string
          nullable: true
          description: Last Updated timestamp of visit
        geofence_id:
          type: string
          format: uuid
          description: GeofenceId associated with visit
        driver_handle:
          type: string
          deprecated: true
          description: Driver handle for this visit
        worker_handle:
          type: string
          description: Worker handle for this visit
        worker_name:
          type: string
          nullable: true
          description: Worker name for this visit
        worker_profile:
          type: object
          nullable: true
          description: Worker profile associated with visit.
          additionalProperties:
            nullable: true
        device_id:
          type: string
          format: uuid
          nullable: true
          description: Device id associated with visit
        order_handle:
          type: string
          description: Order handle for this visit
        place_handle:
          type: string
          nullable: true
          description: Place handle for this visit
        ops_group_handle:
          type: string
          description: Ops Group handle for this visit
        arrival:
          nullable: true
          description: Arrival information of visit
          allOf:
            - $ref: "#/components/schemas/LocationInfo"
        exit:
          nullable: true
          description: Exited information of visit
          allOf:
            - $ref: "#/components/schemas/LocationInfo"
        enroute:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/EnrouteStatsInfo"
        service:
          nullable: true
          description: ""
          allOf:
            - $ref: "#/components/schemas/ServiceStatsInfo"
        metadata:
          type: object
          nullable: true
          description: Metadata associated with this visit.
          additionalProperties:
            nullable: true
        geofence_metadata:
          type: object
          nullable: true
          description: Geofence Metadata associated with the visit.
          additionalProperties:
            nullable: true
        tracking_rate:
          type: number
          description: Driver tracking rate during the lifespan of the order
        system_generated_order_handle:
          type: boolean
          nullable: true
          description: Boolean to filter out orders where order handle was automatically
            generated by HT system
        visit_geometry:
          nullable: true
          description: Geometry of the visit
          allOf:
            - $ref: "#/components/schemas/VisitGeometryModel"
        geofence_address:
          type: string
          nullable: true
          description: Geofence address for this visit
        timezone:
          type: string
          nullable: true
          description: Timezone associated with this visit
        attachments:
          type: array
          nullable: true
          description: Attachments associated with this geotag
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
      required:
        - created_at
        - geofence_id
        - ops_group_handle
        - order_handle
        - visit_id
    PostWorkerInviteRequest:
      type: object
      properties:
        app:
          type: string
          default: ORDERS
          enum:
            - ORDERS
            - VISITS
          nullable: true
          description: Value indicating the HyperTrack app for which the invite should be
            generated. `ORDERS` or `VISITS`.
    PostWorkerInviteResponse:
      type: object
      properties:
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker
        invite_link:
          type: string
          description: App link to be shared with the worker
      required:
        - invite_link
        - worker_handle
    OrderAssignedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - assigned
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        assigned_at:
          type: string
          description: Timestamp at which the order was assigned to a worker
      required:
        - assigned_at
        - order_handle
        - route_handle
        - status
        - value
    OrderStartedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - started
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
      required:
        - order_handle
        - route_handle
        - status
        - value
    OrderOnDeviceGeofenceCheckedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - on_device_geofence_checked
          description: String representation type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        is_inside:
          type: boolean
          description: Boolean representation of whether the worker was inside when he/she
            tried to clockin/clockout
        location_accuracy:
          type: integer
          nullable: true
          description: Accuracy of the location at the time of order webhook event
      required:
        - is_inside
        - order_handle
        - route_handle
        - status
        - value
    OrderFirstEtaWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - first_eta
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        remaining_duration:
          type: integer
          description: Estimated remaining duration (in seconds) for worker to reach order
            destination
        remaining_distance:
          type: integer
          description: Estimated remaining distance (in meters) for worker to travel to
            reach order destination
        estimated_route_id:
          type: string
          nullable: true
          description: Unique identifier for the estimated route associated with this ETA
            event
      required:
        - order_handle
        - remaining_distance
        - remaining_duration
        - route_handle
        - status
        - value
    OrderEtaWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - eta
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        remaining_duration:
          type: integer
          description: Estimated remaining duration (in seconds) for worker to reach order
            destination
        remaining_distance:
          type: integer
          description: Estimated remaining distance (in meters) for worker to travel to
            reach order destination
        estimated_route_id:
          type: string
          nullable: true
          description: Unique identifier for the estimated route associated with this ETA
            event
        driver_location:
          nullable: true
          description: Location of the worker at the time of order webhook event
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        in_outage:
          type: boolean
          nullable: true
          description: Boolean flag whether worker is in outage or not at the time of
            order webhook event
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp indicating the scheduled time of the order
      required:
        - order_handle
        - remaining_distance
        - remaining_duration
        - route_handle
        - status
        - value
    OrderEtaChangeWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - eta_change
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        remaining_duration:
          type: integer
          description: Estimated remaining duration (in seconds) for worker to reach order
            destination
        remaining_distance:
          type: integer
          description: Estimated remaining distance (in meters) for worker to travel to
            reach order destination
        estimated_route_id:
          type: string
          nullable: true
          description: Unique identifier for the estimated route associated with this ETA
            event
        earliest_possible_arrival_time:
          type: string
          nullable: true
          description: Timestamp indicating the earliest possible arrival of the worker at
            the destination.
        change_reason:
          enum:
            - position_update
            - traffic_update
            - route_change
          nullable: true
          description: Reason for the change in ETA.
      required:
        - order_handle
        - remaining_distance
        - remaining_duration
        - route_handle
        - status
        - value
    OrderNMinutesAwayWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - n_minutes_away
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        remaining_duration:
          type: integer
          description: Estimated remaining duration (in seconds) for worker to reach order
            destination
        remaining_distance:
          type: integer
          description: Estimated remaining distance (in meters) for worker to travel to
            reach order destination
        estimated_route_id:
          type: string
          nullable: true
          description: Unique identifier for the estimated route associated with this ETA
            event
        remaining_minutes:
          type: integer
          description: Estimated remaining duration (in minutes) for worker to reach order
            destination
      required:
        - order_handle
        - remaining_distance
        - remaining_duration
        - remaining_minutes
        - route_handle
        - status
        - value
    OrderDeviceSwitchedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - device_switched
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        previous_device_id:
          type: string
          description: Unique identifier for a previously device linked with order
        new_device_id:
          type: string
          description: Unique identifier for a new device linked with order
      required:
        - new_device_id
        - order_handle
        - previous_device_id
        - route_handle
        - status
        - value
    OrderDisabledWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - disabled
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
      required:
        - order_handle
        - route_handle
        - status
        - value
    OrderEnabledWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - enabled
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
      required:
        - order_handle
        - route_handle
        - status
        - value
    OrderUpdatedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - updated
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
      required:
        - order_handle
        - route_handle
        - status
        - value
    OrderDelayedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - delayed
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        arrive_at:
          type: string
          description: Estimated timestamp at which worker is expected to reach order
            destination
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp indicating the scheduled time of the order
        initial_eta:
          type: string
          nullable: true
          description: Initial estimated time of arrival computed when order tracking was
            started
      required:
        - arrive_at
        - order_handle
        - route_handle
        - status
        - value
    OrderRiskUpdatedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - risk_updated
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        risks:
          type: object
          description: Risk information associated with the order at the time when order
            webhook was recorded
          additionalProperties:
            nullable: true
      required:
        - order_handle
        - risks
        - route_handle
        - status
        - value
    WebhookArrivalData:
      type: object
      properties:
        location:
          description: Location of the worker at the time of arrival
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        recorded_at:
          type: string
          description: Timestamp when worker arrived at the order destination
        location_accuracy:
          type: number
          nullable: true
          description: GPS accuracy in meters at time of arrival
      required:
        - location
        - recorded_at
    OrderArrivedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - arrived
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        place_handle:
          type: string
          nullable: true
          description: Unique identifier provided by the customer for a place
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp indicating the scheduled time of the order
        initial_eta:
          type: string
          nullable: true
          description: Initial estimated time of arrival computed when order tracking was
            started
        arrival:
          description: Arrival location and timestamp information
          allOf:
            - $ref: "#/components/schemas/WebhookArrivalData"
      required:
        - arrival
        - order_handle
        - route_handle
        - status
        - value
    WebhookExitData:
      type: object
      properties:
        location:
          nullable: true
          description: Location of the worker at the time of exit
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        recorded_at:
          type: string
          description: Timestamp when worker exited from the order destination
        location_accuracy:
          type: number
          nullable: true
          description: GPS accuracy in meters at time of exit
      required:
        - recorded_at
    OrderExitedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - exited
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        place_handle:
          type: string
          nullable: true
          description: Unique identifier provided by the customer for a place
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp indicating the scheduled time of the order
        initial_eta:
          type: string
          nullable: true
          description: Initial estimated time of arrival computed when order tracking was
            started
        exit:
          description: Exit location and timestamp information
          allOf:
            - $ref: "#/components/schemas/WebhookExitData"
        reason:
          enum:
            - location
            - outage
            - geofence_deleted
            - deleted
          nullable: true
          description: "Reason the visit/order exit was recorded: 'location' (GPS exit
            with coordinates), 'outage' (closed without a location, e.g.
            tracking stopped), 'geofence_deleted' (order completed/geofence
            removed), or 'deleted'"
      required:
        - exit
        - order_handle
        - route_handle
        - status
        - value
    OrderCompletedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - completed
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        distance:
          type: integer
          nullable: true
          description: Distance travelled (in meters) during the order
        duration:
          type: integer
          description: Total duration (in seconds) of the order
        deviation:
          type: integer
          nullable: true
          description: Distance (in meters) between the actual completion location to the
            order destination
        actual_service_time:
          type: integer
          nullable: true
          description: Time (in seconds) that the worker spent at the order location when
            servicing the order
      required:
        - duration
        - order_handle
        - route_handle
        - status
        - value
    OrderCancelledWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - cancelled
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        distance:
          type: integer
          nullable: true
          description: Distance travelled (in meters) during the order
        duration:
          type: integer
          description: Total duration (in seconds) of the order
      required:
        - duration
        - order_handle
        - route_handle
        - status
        - value
    BreakTimeTuple:
      type: object
      properties:
        start_time:
          type: string
          description: Timestamp indicating the start of breaktime.
        end_time:
          type: string
          description: Timestamp indicating the end of breaktime.
      required:
        - end_time
        - start_time
    BillingBreakTimeModelFine:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the breaktime.
        ht_val:
          nullable: true
          description: Hypertrack's inference for the breaktime.
          allOf:
            - $ref: "#/components/schemas/BreakTimeTuple"
        worker_val:
          nullable: true
          description: Worker's assessment for the breaktime.
          allOf:
            - $ref: "#/components/schemas/BreakTimeTuple"
        facility_val:
          nullable: true
          description: Facility's assessment for the breaktime.
          allOf:
            - $ref: "#/components/schemas/BreakTimeTuple"
      required:
        - id
    BillingConstituents:
      type: object
      properties:
        travel_time:
          type: integer
          description: Time spent traveling to the order destination.
        service_time:
          type: integer
          description: Time spent servicing the order.
        over_time:
          type: integer
          description: Time spent working beyond the expected finish time.
        arrival_delay:
          type: integer
          description: Delay in arrival to the order destination beyond expected start time.
        post_shift_tracking_time:
          type: integer
          description: Time spent tracking the worker post work completion.
        break_time:
          type: array
          nullable: true
          description: List of breaktimes for the order.
          items:
            $ref: "#/components/schemas/BillingBreakTimeModelFine"
      required:
        - arrival_delay
        - over_time
        - post_shift_tracking_time
        - service_time
        - travel_time
    OrderBillingDetailsUpdatedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - billing_details_updated
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        billing_details:
          description: Complete billing details for the order
          allOf:
            - $ref: "#/components/schemas/BillingConstituents"
        billable_hours:
          type: integer
          description: Total billable hours computed for the order
      required:
        - billable_hours
        - billing_details
        - order_handle
        - route_handle
        - status
        - value
    OrderTaskCreatedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - task_created
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        task:
          description: Task associated with the order webhook event
          allOf:
            - $ref: "#/components/schemas/OrderTaskResponse"
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp indicating the scheduled time of the order
      required:
        - order_handle
        - route_handle
        - status
        - task
        - value
    OrderTaskUpdatedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - task_updated
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        task:
          description: Task associated with the order webhook event
          allOf:
            - $ref: "#/components/schemas/OrderTaskResponse"
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp indicating the scheduled time of the order
      required:
        - order_handle
        - route_handle
        - status
        - task
        - value
    OrderTaskCompletedWebhookEventData:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique handle of the order
        route_handle:
          type: string
          description: Unique identifier for the route to which the order belongs
        value:
          enum:
            - task_completed
          description: String representing type of order webhook
        status:
          type: string
          description: Status of the order at the time of webhook event
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        task:
          description: Task associated with the order webhook event
          allOf:
            - $ref: "#/components/schemas/OrderTaskResponse"
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp indicating the scheduled time of the order
      required:
        - order_handle
        - route_handle
        - status
        - task
        - value
    OrderWebhookEvent:
      type: object
      properties:
        account_id:
          type: string
          description: Unique Identifier for the account registered with HyperTrack
        recorded_at:
          type: string
          description: Timestamp at which the order webhook event was recorded
        created_at:
          type: string
          description: Timestamp at which the order webhook event was sent
        device_id:
          type: string
          description: Unique identifier for a device
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
          deprecated: true
        type:
          enum:
            - order
          description: Type of webhook. Here the value will be `order`
        location:
          nullable: true
          description: Location of the worker at the time of order webhook event
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        version:
          type: string
          description: Version of the webhook event
        data:
          description: Object containing information specific to the value of the webhook
          oneOf:
            - $ref: "#/components/schemas/OrderAssignedWebhookEventData"
            - $ref: "#/components/schemas/OrderStartedWebhookEventData"
            - $ref: "#/components/schemas/OrderOnDeviceGeofenceCheckedWebhookEventData"
            - $ref: "#/components/schemas/OrderFirstEtaWebhookEventData"
            - $ref: "#/components/schemas/OrderEtaWebhookEventData"
            - $ref: "#/components/schemas/OrderEtaChangeWebhookEventData"
            - $ref: "#/components/schemas/OrderNMinutesAwayWebhookEventData"
            - $ref: "#/components/schemas/OrderDeviceSwitchedWebhookEventData"
            - $ref: "#/components/schemas/OrderDisabledWebhookEventData"
            - $ref: "#/components/schemas/OrderEnabledWebhookEventData"
            - $ref: "#/components/schemas/OrderUpdatedWebhookEventData"
            - $ref: "#/components/schemas/OrderDelayedWebhookEventData"
            - $ref: "#/components/schemas/OrderRiskUpdatedWebhookEventData"
            - $ref: "#/components/schemas/OrderArrivedWebhookEventData"
            - $ref: "#/components/schemas/OrderExitedWebhookEventData"
            - $ref: "#/components/schemas/OrderCompletedWebhookEventData"
            - $ref: "#/components/schemas/OrderCancelledWebhookEventData"
            - $ref: "#/components/schemas/OrderBillingDetailsUpdatedWebhookEventData"
            - $ref: "#/components/schemas/OrderTaskCreatedWebhookEventData"
            - $ref: "#/components/schemas/OrderTaskUpdatedWebhookEventData"
            - $ref: "#/components/schemas/OrderTaskCompletedWebhookEventData"
        delivery_http_status:
          type: integer
          nullable: true
          description: HTTP status code returned by the customer endpoint when the webhook
            was delivered
        retry_count:
          type: integer
          nullable: true
          description: Number of delivery retries attempted for the webhook
        delivery_http_response_text:
          type: string
          nullable: true
          description: Response body returned by the customer endpoint when the webhook
            was delivered
      required:
        - account_id
        - created_at
        - data
        - device_id
        - recorded_at
        - type
        - version
    GetOrderWebhooksResponse:
      type: object
      properties:
        webhooks:
          type: array
          nullable: true
          description: List of Webhooks sent for the order
          items:
            $ref: "#/components/schemas/OrderWebhookEvent"
        pagination_token:
          type: string
          nullable: true
          description: Token to fetch next page of webhooks for the order
    CompleteOrderRequest:
      type: object
      properties: {}
    CompleteOrderResponse:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        created_by:
          nullable: true
          description: Who created the order
          allOf:
            - $ref: "#/components/schemas/Source"
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        destination:
          nullable: true
          description: Destination for the order
          oneOf:
            - $ref: "#/components/schemas/OrderDetailPointDestination"
            - $ref: "#/components/schemas/OrderDetailPolygonDestination"
            - $ref: "#/components/schemas/OrderDetailGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderDetailPlaceHandleDestination"
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the order is associated
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the order was planned - `manual`, `scheduled`
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderDetailEstimate"
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify if the order is a pick/drop
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        plan_id:
          type: string
          nullable: true
          description: Unique identifier of the plan
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the order is tracked in flex, on_time,
            on_shift, full_shift or pre_shift mode
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Total time tracked in seconds for the driver at the location when
            fulfilling the order
        polyline:
          nullable: true
          description: GeoJSON representation of polyline with the coordinates of the
            actual path travelled by the driver
          allOf:
            - $ref: "#/components/schemas/Polyline"
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
        cancelled_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was cancelled at destination
        visited_destination:
          type: boolean
          nullable: true
          description: Indicates whether the driver visited the destination
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the order
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking once the order was
            fulfilled or cancelled
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        images:
          type: array
          nullable: true
          description: List of URLs to be used to retrieve images associated with the order
          items:
            type: string
        order_score:
          type: number
          nullable: true
          description: ""
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        previous_fulfillments:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/FulfillmentAttempt"
        parking:
          type: array
          nullable: true
          description: Parkings associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderParkingResponse"
        checkin:
          type: array
          nullable: true
          description: Checkins associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderCheckinResponse"
        service_area:
          type: array
          nullable: true
          description: Service Areas associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderServiceAreaResponse"
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first location after device's tracking
            is initiated for the route
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first event after device's tracking is
            initiated for the route
        timeline:
          type: array
          nullable: true
          description: New Order timeline events sorted by event time
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverActivityEvent"
              - $ref: "#/components/schemas/DriverOutageEvent"
              - $ref: "#/components/schemas/DriverStatusUpdatedEvent"
              - $ref: "#/components/schemas/OrderCreatedEvent"
              - $ref: "#/components/schemas/OrderAssignedEvent"
              - $ref: "#/components/schemas/OrderStartedEvent"
              - $ref: "#/components/schemas/OrderCompletedEvent"
              - $ref: "#/components/schemas/OrderCancelledEvent"
              - $ref: "#/components/schemas/OrderEnterExitEvent"
              - $ref: "#/components/schemas/OrderInferredEvent"
              - $ref: "#/components/schemas/OrderCustomEvent"
              - $ref: "#/components/schemas/OrderServiceEvent"
              - $ref: "#/components/schemas/DriverDeviceLinkedEvent"
              - $ref: "#/components/schemas/DriverDeviceUnlinkedEvent"
              - $ref: "#/components/schemas/DeviceDisconnectedEvent"
        worker_name:
          type: string
          nullable: true
          description: Name of the worker to whom order is assigned.
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which order is expected to switch device
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        billing_details:
          nullable: true
          description: Billing details for the order.
          allOf:
            - $ref: "#/components/schemas/OrderBillingDetails"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order
        tasks:
          type: array
          nullable: true
          description: tasks associated with the order
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
        metrics:
          nullable: true
          description: Metrics associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderMetrics"
        timesheets:
          type: array
          nullable: true
          description: Timesheet entries for the order. Includes HyperTrack-computed
            (HypertrackLocationTimesheet) and customer-provided entries.
          items:
            oneOf:
              - $ref: "#/components/schemas/HypertrackLocationTimesheet"
              - type: object
                additionalProperties:
                  nullable: true
        agent:
          nullable: true
          description: Closeout copilot review data. Contains a `status` field (e.g.
            "approved") and a `timesheets` list of agent-collected or
            agent-reconciled entries. Null when closeout is not enabled or no
            review has taken place.
          allOf:
            - $ref: "#/components/schemas/AgentReview"
      required:
        - completed_at
        - order_handle
        - status
    ReassignOrderRequest:
      type: object
      properties:
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the new driver to whom the
            order needs to be assigned to
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the new worker to whom the
            order needs to be assigned to
        ops_group_handle:
          type: string
          nullable: true
          description: Unique Handle of Ops Group to which worker belongs. Needed if a
            worker belongs to multiple ops groups
        order_type:
          type: string
          nullable: true
          description: Type of the order which can be `drop` or `pick`
        type_index:
          type: integer
          nullable: true
          description: Integer representing the `pick` or `drop` order index when having a
            pick/drop scenario
    ReassignOrderResponse:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        created_by:
          nullable: true
          description: Who created the order
          allOf:
            - $ref: "#/components/schemas/Source"
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        destination:
          nullable: true
          description: Destination for the order
          oneOf:
            - $ref: "#/components/schemas/OrderDetailPointDestination"
            - $ref: "#/components/schemas/OrderDetailPolygonDestination"
            - $ref: "#/components/schemas/OrderDetailGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderDetailPlaceHandleDestination"
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the order is associated
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the order was planned - `manual`, `scheduled`
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          description: Timestamp at which the order was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderDetailEstimate"
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify if the order is a pick/drop
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        plan_id:
          type: string
          nullable: true
          description: Unique identifier of the plan
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the order is tracked in flex, on_time,
            on_shift, full_shift or pre_shift mode
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Total time tracked in seconds for the driver at the location when
            fulfilling the order
        polyline:
          nullable: true
          description: GeoJSON representation of polyline with the coordinates of the
            actual path travelled by the driver
          allOf:
            - $ref: "#/components/schemas/Polyline"
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
        cancelled_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was cancelled at destination
        visited_destination:
          type: boolean
          nullable: true
          description: Indicates whether the driver visited the destination
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the order
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking once the order was
            fulfilled or cancelled
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        images:
          type: array
          nullable: true
          description: List of URLs to be used to retrieve images associated with the order
          items:
            type: string
        order_score:
          type: number
          nullable: true
          description: ""
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        previous_fulfillments:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/FulfillmentAttempt"
        parking:
          type: array
          nullable: true
          description: Parkings associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderParkingResponse"
        checkin:
          type: array
          nullable: true
          description: Checkins associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderCheckinResponse"
        service_area:
          type: array
          nullable: true
          description: Service Areas associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderServiceAreaResponse"
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first location after device's tracking
            is initiated for the route
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first event after device's tracking is
            initiated for the route
        timeline:
          type: array
          nullable: true
          description: New Order timeline events sorted by event time
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverActivityEvent"
              - $ref: "#/components/schemas/DriverOutageEvent"
              - $ref: "#/components/schemas/DriverStatusUpdatedEvent"
              - $ref: "#/components/schemas/OrderCreatedEvent"
              - $ref: "#/components/schemas/OrderAssignedEvent"
              - $ref: "#/components/schemas/OrderStartedEvent"
              - $ref: "#/components/schemas/OrderCompletedEvent"
              - $ref: "#/components/schemas/OrderCancelledEvent"
              - $ref: "#/components/schemas/OrderEnterExitEvent"
              - $ref: "#/components/schemas/OrderInferredEvent"
              - $ref: "#/components/schemas/OrderCustomEvent"
              - $ref: "#/components/schemas/OrderServiceEvent"
              - $ref: "#/components/schemas/DriverDeviceLinkedEvent"
              - $ref: "#/components/schemas/DriverDeviceUnlinkedEvent"
              - $ref: "#/components/schemas/DeviceDisconnectedEvent"
        worker_name:
          type: string
          nullable: true
          description: Name of the worker to whom order is assigned.
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which order is expected to switch device
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        billing_details:
          nullable: true
          description: Billing details for the order.
          allOf:
            - $ref: "#/components/schemas/OrderBillingDetails"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order
        tasks:
          type: array
          nullable: true
          description: tasks associated with the order
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
        metrics:
          nullable: true
          description: Metrics associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderMetrics"
        timesheets:
          type: array
          nullable: true
          description: Timesheet entries for the order. Includes HyperTrack-computed
            (HypertrackLocationTimesheet) and customer-provided entries.
          items:
            oneOf:
              - $ref: "#/components/schemas/HypertrackLocationTimesheet"
              - type: object
                additionalProperties:
                  nullable: true
        agent:
          nullable: true
          description: Closeout copilot review data. Contains a `status` field (e.g.
            "approved") and a `timesheets` list of agent-collected or
            agent-reconciled entries. Null when closeout is not enabled or no
            review has taken place.
          allOf:
            - $ref: "#/components/schemas/AgentReview"
      required:
        - assigned_at
        - order_handle
        - status
    OrderWithHandleInput:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
      required:
        - order_handle
    TriggerPlanningRequest:
      type: object
      properties:
        orders:
          type: array
          nullable: true
          description: List of orders to plan
          items:
            $ref: "#/components/schemas/OrderWithHandleInput"
        plan_mode:
          type: string
          default: on_demand
          enum:
            - scheduled
            - on_demand
          nullable: true
          description: Mode of planning to be used to plan orders
    PlanOrdersResponse:
      type: object
      properties:
        message:
          type: string
          nullable: true
          description: Message on the status of planning. Provided if the request does not
            have plan_mode as `manual`
        plan:
          nullable: true
          description: Information about asynchronous planning of the orders provided
          allOf:
            - $ref: "#/components/schemas/Plan"
    CreateLocateRequest:
      type: object
      properties: {}
    LineStringLocation1:
      type: object
      properties:
        type:
          type: string
          description: Type of location object
        coordinates:
          type: array
          description: Array of coordinates and the recorded_at timestamp
          items:
            type: array
            items:
              nullable: true
      required:
        - coordinates
        - type
    GetWorkerHistoryResponse:
      type: object
      properties:
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker
        locations:
          description: List of locations for the worker's device
          allOf:
            - $ref: "#/components/schemas/LineStringLocation1"
        markers:
          type: array
          description: List of markers summarising the history of the worker
          items:
            type: object
            additionalProperties:
              nullable: true
        started_at:
          type: string
          description: Time from where the history is requested from
        completed_at:
          type: string
          description: Time to where the history is requested to
        distance:
          type: integer
          description: Distance tracked during the duration of history
        duration:
          type: integer
          description: Duration tracked during the duration of history
        steps:
          type: integer
          description: Number of steps taken by worker during the duration of history
      required:
        - completed_at
        - distance
        - duration
        - locations
        - markers
        - started_at
        - steps
        - worker_handle
    UndeleteWorkerResponse:
      type: object
      properties:
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker
        name:
          type: string
          nullable: true
          description: Name of the worker
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group to which the worker belongs
        product_types:
          type: array
          description: List of product types used for worker matching during order planning
          items:
            type: string
        device_id:
          type: string
          nullable: true
          description: Unique ID representing the worker's device
        profile:
          type: object
          description: Metadata associated with a worker
          additionalProperties:
            nullable: true
        work_status:
          description: work_status of the worker with respect to availability and on order
            fulfilment
          allOf:
            - $ref: "#/components/schemas/DriverStatus1"
        schedule:
          type: array
          nullable: true
          description: List indicating the schedule of a worker for work assignment
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverDateSchedule"
              - $ref: "#/components/schemas/DriverRecurringSchedule"
        deleted:
          type: boolean
          nullable: true
          description: Flag indicating whether the worker was deleted
        created_at:
          type: string
          description: Timestamp at which the worker was created
        home:
          description: Worker home
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadiusResponse"
        deleted_at:
          type: string
          nullable: true
          description: Timestamp at which the worker was deleted
        location:
          nullable: true
          description: Last known location of the worker.
          allOf:
            - $ref: "#/components/schemas/MovementLocationResponse"
        device_status:
          nullable: true
          description: Current status of the device used by the worker
          allOf:
            - $ref: "#/components/schemas/DeviceStatus1"
        unavailable_on:
          type: array
          description: List of dates (YYYY-MM-DD) on which the worker is not available
          items:
            type: string
        summary:
          nullable: true
          description: Summary of work done by the worker during the specified time range.
            Default last 24 hours.
          allOf:
            - $ref: "#/components/schemas/DriverSummary1"
        location_permission:
          nullable: true
          description: Last known location permission on the worker's device
          allOf:
            - $ref: "#/components/schemas/LocationPermission1"
        device_info:
          nullable: true
          description: Information of the Device associated with Worker
          allOf:
            - $ref: "#/components/schemas/DeviceInfo"
        battery:
          nullable: true
          description: Information of the battery status.
          allOf:
            - $ref: "#/components/schemas/BatteryStatus1"
        timezone:
          type: string
          nullable: true
          description: Timezone of the worker
      required:
        - created_at
        - home
        - ops_group_handle
        - product_types
        - profile
        - unavailable_on
        - work_status
        - worker_handle
    RescheduleOrderRequest:
      type: object
      properties:
        scheduled_at:
          type: string
          description: Schedule time by which order needs to be fulfilled
        scheduled_after:
          type: string
          nullable: true
          description: Schedule time after which the worker needs to fulfill order
            (similar to slot start)
      required:
        - scheduled_at
    RescheduleOrderResponse:
      type: object
      properties:
        order_handle:
          type: string
          description: Unique customer provided identifier for an order
        status:
          type: string
          enum:
            - completed
            - cancelled
            - disabled
            - ongoing
            - unplanned
            - assigned
            - planned
            - dispatched
            - summarizing
          description: Current state of the order
        fulfillment_attempt:
          type: integer
          nullable: true
          description: Number identifying the attempt count for the order
        created_at:
          type: string
          nullable: true
          description: Timestamp at which the order was created
        rescheduled_marked_at:
          type: string
          nullable: true
          description: Timestamp at which the order was rescheduled
        created_by:
          nullable: true
          description: Who created the order
          allOf:
            - $ref: "#/components/schemas/Source"
        risk_status:
          type: boolean
          nullable: true
          description: Flag indicating whether the order is at risk
        destination:
          nullable: true
          description: Destination for the order
          oneOf:
            - $ref: "#/components/schemas/OrderDetailPointDestination"
            - $ref: "#/components/schemas/OrderDetailPolygonDestination"
            - $ref: "#/components/schemas/OrderDetailGeofenceIdDestination"
            - $ref: "#/components/schemas/OrderDetailPlaceHandleDestination"
        ops_group_handle:
          type: string
          nullable: true
          description: Unique identifier for the ops group to which the order is associated
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the order was planned - `manual`, `scheduled`
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the order tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the order was planned into a route
        scheduled_at:
          type: string
          nullable: true
          description: Timestamp by which the order should be fulfilled to meet the
            customer promise
        scheduled_after:
          type: string
          nullable: true
          description: Timestamp after which the order should be fulfilled to meet the
            customer promise
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the order was completed
        cancelled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was cancelled
        cancellation_source:
          type: object
          nullable: true
          description: Detail about how order got cancelled
          additionalProperties:
            nullable: true
        disabled_at:
          type: string
          nullable: true
          description: Timestamp at which the order was disabled so that it can be
            fulfillment later
        enabled_at:
          type: string
          nullable: true
          description: Timestamp at which the disabled order was enabled for fulfillment
        arrived_at:
          type: string
          nullable: true
          description: Timestamp at which the driver arrived at the order fulfillment
            location
        exited_at:
          type: string
          nullable: true
          description: Timestamp at which the driver exited from the order fulfillment
            location
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the order
          additionalProperties:
            nullable: true
        estimate:
          nullable: true
          description: Object containing the estimate information for the order that has
            not been completed
          allOf:
            - $ref: "#/components/schemas/OrderDetailEstimate"
        risks:
          type: object
          nullable: true
          description: Object containing different risk statuses for the order
          additionalProperties:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is expected to spend at the
            location when fulfilling the order
        product_type:
          type: array
          nullable: true
          description: List of customer provided product/service types used when matching
            orders to a driver
          items:
            type: string
        type:
          type: string
          enum:
            - pick
            - drop
          nullable: true
          description: Field to specify if the order is a pick/drop
        type_index:
          type: integer
          nullable: true
          description: Field to specify if the order is a pick/drop
        capacity_used:
          type: integer
          nullable: true
          description: Volumetric unit occupied by the order
        region:
          nullable: true
          description: City, state, and country where the orders needs to be fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Total distance in meters travelled by the driver to reach the order
            location
        duration:
          type: integer
          nullable: true
          description: Total time in seconds spent on the order.
        share_url:
          type: string
          nullable: true
          description: Shareable URL for the consumer to track the live movement of the
            drive after the order is dispatched
        embed_url:
          type: string
          nullable: true
          description: Embeddable URL for the ops team to view order timeline
        route_handle:
          type: string
          nullable: true
          description: Unique identifier for the route
        plan_id:
          type: string
          nullable: true
          description: Unique identifier of the plan
        planning_failure_reason:
          type: string
          nullable: true
          description: Reason explaining why automated planning left the order unplanned.
            Present only when a planning attempt could not assign the order. See
            [Planning failure reasons](#planning-failure-reasons) for possible
            values.
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the order is tracked in flex, on_time,
            on_shift, full_shift or pre_shift mode
        actual_service_time:
          type: integer
          nullable: true
          description: Time in seconds that the driver is actually spent at the location
            when fulfilling the order
        tracked_service_time:
          type: integer
          nullable: true
          description: Total time tracked in seconds for the driver at the location when
            fulfilling the order
        polyline:
          nullable: true
          description: GeoJSON representation of polyline with the coordinates of the
            actual path travelled by the driver
          allOf:
            - $ref: "#/components/schemas/Polyline"
        deviation_from_destination:
          type: integer
          nullable: true
          description: Distance in meters between the actual completion location to the
            order location
        completed_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was completed at destination
        cancelled_at_destination:
          type: boolean
          nullable: true
          description: Indicates whether the order was cancelled at destination
        visited_destination:
          type: boolean
          nullable: true
          description: Indicates whether the driver visited the destination
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            order. Values lie between 0.0 and 1.0
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the order
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking once the order was
            fulfilled or cancelled
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        images:
          type: array
          nullable: true
          description: List of URLs to be used to retrieve images associated with the order
          items:
            type: string
        order_score:
          type: number
          nullable: true
          description: ""
        attachments:
          type: array
          nullable: true
          description: Attachments for this order
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment1"
              - $ref: "#/components/schemas/NoteAttachment1"
              - $ref: "#/components/schemas/SignatureAttachment1"
        previous_fulfillments:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/FulfillmentAttempt"
        parking:
          type: array
          nullable: true
          description: Parkings associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderParkingResponse"
        checkin:
          type: array
          nullable: true
          description: Checkins associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderCheckinResponse"
        service_area:
          type: array
          nullable: true
          description: Service Areas associated with the order fulfillment
          items:
            $ref: "#/components/schemas/OrderServiceAreaResponse"
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first location after device's tracking
            is initiated for the route
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first event after device's tracking is
            initiated for the route
        timeline:
          type: array
          nullable: true
          description: New Order timeline events sorted by event time
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverActivityEvent"
              - $ref: "#/components/schemas/DriverOutageEvent"
              - $ref: "#/components/schemas/DriverStatusUpdatedEvent"
              - $ref: "#/components/schemas/OrderCreatedEvent"
              - $ref: "#/components/schemas/OrderAssignedEvent"
              - $ref: "#/components/schemas/OrderStartedEvent"
              - $ref: "#/components/schemas/OrderCompletedEvent"
              - $ref: "#/components/schemas/OrderCancelledEvent"
              - $ref: "#/components/schemas/OrderEnterExitEvent"
              - $ref: "#/components/schemas/OrderInferredEvent"
              - $ref: "#/components/schemas/OrderCustomEvent"
              - $ref: "#/components/schemas/OrderServiceEvent"
              - $ref: "#/components/schemas/DriverDeviceLinkedEvent"
              - $ref: "#/components/schemas/DriverDeviceUnlinkedEvent"
              - $ref: "#/components/schemas/DeviceDisconnectedEvent"
        worker_name:
          type: string
          nullable: true
          description: Name of the worker to whom order is assigned.
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which order is expected to switch device
        place_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier of the place
        billing_details:
          nullable: true
          description: Billing details for the order.
          allOf:
            - $ref: "#/components/schemas/OrderBillingDetails"
        priority:
          enum:
            - low
            - medium
            - high
          nullable: true
          description: Priority of the order
        tasks:
          type: array
          nullable: true
          description: tasks associated with the order
          items:
            $ref: "#/components/schemas/OrderTaskResponse"
        metrics:
          nullable: true
          description: Metrics associated with the order
          allOf:
            - $ref: "#/components/schemas/OrderMetrics"
        timesheets:
          type: array
          nullable: true
          description: Timesheet entries for the order. Includes HyperTrack-computed
            (HypertrackLocationTimesheet) and customer-provided entries.
          items:
            oneOf:
              - $ref: "#/components/schemas/HypertrackLocationTimesheet"
              - type: object
                additionalProperties:
                  nullable: true
        agent:
          nullable: true
          description: Closeout copilot review data. Contains a `status` field (e.g.
            "approved") and a `timesheets` list of agent-collected or
            agent-reconciled entries. Null when closeout is not enabled or no
            review has taken place.
          allOf:
            - $ref: "#/components/schemas/AgentReview"
      required:
        - order_handle
        - status
    AddOrderToRouteRequest:
      type: object
      properties:
        orders:
          type: array
          description: List of unplanned orders to be added to the route
          items:
            $ref: "#/components/schemas/OrderHandleInput"
        resequence:
          type: boolean
          nullable: true
          description: Flag to add each order to the route at the most optimal position
      required:
        - orders
    AddOrderToRouteResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    WorkerApproverResponse:
      type: object
      properties:
        worker_handle:
          type: string
          description: Handle of the worker
        approver_id:
          type: string
          description: ID of the approver
        approver_type:
          type: string
          description: "Type of approver: 'worker' or 'dashboard_user'"
        created_at:
          type: string
          nullable: true
          description: When the approver was created
        updated_at:
          type: string
          nullable: true
          description: When the approver was last updated
      required:
        - approver_id
        - approver_type
        - worker_handle
    WorkerApproverListResponse:
      type: object
      properties:
        approvers:
          type: array
          description: List of worker approvers
          items:
            $ref: "#/components/schemas/WorkerApproverResponse"
        total_count:
          type: integer
          description: Total number of approvers
        limit:
          type: integer
          description: Maximum number of approvers returned
        pagination_token:
          type: string
          nullable: true
          description: Token for next page of results
      required:
        - approvers
        - limit
        - total_count
    CreateWorkerApproverRequest:
      type: object
      properties:
        approver_id:
          type: string
          description: ID of the approver
        approver_type:
          enum:
            - worker
            - dashboard_user
          description: "Type of approver: 'worker' or 'dashboard_user'"
      required:
        - approver_id
        - approver_type
    SetWorkerStatusRequest:
      type: object
      properties:
        tracking:
          type: boolean
          nullable: true
          description: Flag set to indicate that the worker is being tracked while working
        available:
          type: boolean
          nullable: true
          description: Flag set to indicate that the worker is available for work
    SetWorkerStatusResponse:
      type: object
      properties:
        worker_handle:
          type: string
          description: Unique customer provided identifier for a worker
        name:
          type: string
          nullable: true
          description: Name of the worker
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group to which the worker belongs
        product_types:
          type: array
          description: List of product types used for worker matching during order planning
          items:
            type: string
        device_id:
          type: string
          nullable: true
          description: Unique ID representing the worker's device
        profile:
          type: object
          description: Metadata associated with a worker
          additionalProperties:
            nullable: true
        work_status:
          description: work_status of the worker with respect to availability and on order
            fulfilment
          allOf:
            - $ref: "#/components/schemas/DriverStatus1"
        schedule:
          type: array
          nullable: true
          description: List indicating the schedule of a worker for work assignment
          items:
            oneOf:
              - $ref: "#/components/schemas/DriverDateSchedule"
              - $ref: "#/components/schemas/DriverRecurringSchedule"
        deleted:
          type: boolean
          nullable: true
          description: Flag indicating whether the worker was deleted
        created_at:
          type: string
          description: Timestamp at which the worker was created
        home:
          description: Worker home
          allOf:
            - $ref: "#/components/schemas/LocationWithoutRadiusResponse"
        deleted_at:
          type: string
          nullable: true
          description: Timestamp at which the worker was deleted
        location:
          nullable: true
          description: Last known location of the worker.
          allOf:
            - $ref: "#/components/schemas/MovementLocationResponse"
        device_status:
          nullable: true
          description: Current status of the device used by the worker
          allOf:
            - $ref: "#/components/schemas/DeviceStatus1"
        unavailable_on:
          type: array
          description: List of dates (YYYY-MM-DD) on which the worker is not available
          items:
            type: string
        summary:
          nullable: true
          description: Summary of work done by the worker during the specified time range.
            Default last 24 hours.
          allOf:
            - $ref: "#/components/schemas/DriverSummary1"
        location_permission:
          nullable: true
          description: Last known location permission on the worker's device
          allOf:
            - $ref: "#/components/schemas/LocationPermission1"
        device_info:
          nullable: true
          description: Information of the Device associated with Worker
          allOf:
            - $ref: "#/components/schemas/DeviceInfo"
        battery:
          nullable: true
          description: Information of the battery status.
          allOf:
            - $ref: "#/components/schemas/BatteryStatus1"
        timezone:
          type: string
          nullable: true
          description: Timezone of the worker
      required:
        - created_at
        - home
        - ops_group_handle
        - product_types
        - profile
        - unavailable_on
        - work_status
        - worker_handle
    RemoveOrderFromRouteRequest:
      type: object
      properties:
        orders:
          type: array
          description: List of orders to be removed from the route
          items:
            $ref: "#/components/schemas/OrderHandleInput"
      required:
        - orders
    RemoveOrderFromRouteResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    GetOpsGroupResponse:
      type: object
      properties:
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group
        ops_group_label:
          type: string
          description: Identifier label for an Ops Group
        timezone:
          type: string
          description: IANA timezone of the Ops Group
        route_start_location:
          type: string
          description: Configuration to identify where routes are expected to start
        route_completion_type:
          type: string
          description: Configuration to identify where routes are expected to end
        objective_fn:
          type: string
          description: Configuration to identify the metric used by the solver when
            generating optimized routes
        ops_group_home:
          description: Location of the Ops Group
          allOf:
            - $ref: "#/components/schemas/OpsGroupHome"
        default_shift_start_time:
          type: string
          description: Default time HH:mm when the shift starts for drivers
        default_shift_end_time:
          type: string
          description: Default time HH:mm when the shift ends for drivers
        route_capacity:
          type: integer
          description: Maximum number of orders in a route
        route_max_distance:
          type: integer
          description: Maximum distance in meters used by the resolver to constrain each
            route distance
        deleted:
          type: boolean
          description: Flag to include deleted ops groups
        deleted_at:
          type: string
          description: Timestamp at which the OpsGroup was deleted
        shift_availability_mode:
          type: string
          description: Flag to start/stop availability of all drivers based on the ops
            group shift
        order_tracking_mode:
          type: string
          nullable: true
          description: Order tracking mode associated with the ops-group
          deprecated: true
        schedule:
          type: array
          nullable: true
          description: List of schedules used for ops group workers for work assignment
            and shift tracking
          items:
            oneOf:
              - $ref: "#/components/schemas/OpsGroupDateSchedule"
              - $ref: "#/components/schemas/OpsGroupRecurringSchedule"
        order_tracking_automation:
          nullable: true
          description: A configuration object to enable/disable and customize automatic
            order tracking.
          allOf:
            - $ref: "#/components/schemas/OpsGroupOrderTrackingAutomation"
        work_status_automation:
          type: array
          nullable: true
          description: 'List of configuration object to enable/disable and customize
            automatic work status updation. If `null`, the default behavior is
            equivalent to: `{"type": "manual"}`.'
          items:
            $ref: "#/components/schemas/WorkStatusAutomation"
        app_config:
          type: object
          nullable: true
          description: Configuration specific to order's app
          additionalProperties:
            nullable: true
        operations_radius:
          type: integer
          nullable: true
          description: Maximum distance in meters from the ops group home within which
            order destinations are allowed
        enforce_operations_radius:
          type: boolean
          nullable: true
          description: Whether to enforce operations_radius validation at order creation
            time
      required:
        - ops_group_handle
        - ops_group_label
        - route_capacity
        - route_max_distance
        - shift_availability_mode
        - timezone
    PatchOpsGroupRequest:
      type: object
      properties:
        ops_group_label:
          type: string
          nullable: true
          description: Display name for an Ops Group
        route_start_location:
          type: string
          enum:
            - driver_home
            - ops_group_home
            - live_location
          nullable: true
          description: Configuration to identify where routes are expected to start
        route_completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
        objective_fn:
          type: string
          enum:
            - minimise_time
            - minimise_distance
          nullable: true
          description: Configuration to identify the metric used by the solver when
            generating optimized routes
        ops_group_home:
          nullable: true
          description: Location of the Ops Group
          allOf:
            - $ref: "#/components/schemas/OpsGroupHomeRequest"
        default_shift_start_time:
          type: string
          nullable: true
          description: Default time HH:mm when the shift starts for drivers
        default_shift_end_time:
          type: string
          nullable: true
          description: Default time HH:mm when the shift ends for drivers
        route_capacity:
          type: integer
          nullable: true
          description: Maximum number of orders in a route
        route_max_distance:
          type: integer
          nullable: true
          description: Maximum distance in meters used by the resolver to constrain each
            route distance
        timezone:
          type: string
          nullable: true
          description: IANA timezone of the Ops Group
        shift_availability_mode:
          type: string
          enum:
            - auto
            - manual
          nullable: true
          description: Flag to start/stop availability of all drivers based on the ops
            group shift
          deprecated: true
        order_tracking_mode:
          type: string
          nullable: true
          description: Order tracking mode associated with the ops-group
          deprecated: true
        order_tracking_automation:
          nullable: true
          description: A configuration object to enable/disable and customize automatic
            order tracking.
          allOf:
            - $ref: "#/components/schemas/OpsGroupOrderTrackingAutomation"
        work_status_automation:
          type: array
          nullable: true
          description: 'List of configuration object to enable/disable and customize
            automatic work status updation. If `null`, the default behavior is
            equivalent to: `{"type": "manual"}`.'
          items:
            $ref: "#/components/schemas/WorkStatusAutomation"
        schedule:
          type: array
          nullable: true
          description: List of schedules used for ops group workers matching during order
            planning and auto start/stop of availability or tracking of the
            workers
          items:
            oneOf:
              - $ref: "#/components/schemas/OpsGroupDateSchedule"
              - $ref: "#/components/schemas/OpsGroupRecurringSchedule"
        app_config:
          type: object
          nullable: true
          description: Configuration specific to order's app
          additionalProperties:
            nullable: true
        operations_radius:
          type: integer
          nullable: true
          description: Maximum distance in meters from the ops group home within which
            order destinations are allowed
        enforce_operations_radius:
          type: boolean
          nullable: true
          description: Whether to enforce operations_radius validation at order creation
            time
    PatchOpsGroupResponse:
      type: object
      properties:
        ops_group_handle:
          type: string
          description: Unique identifier for an Ops Group
        ops_group_label:
          type: string
          description: Identifier label for an Ops Group
        timezone:
          type: string
          description: IANA timezone of the Ops Group
        route_start_location:
          type: string
          description: Configuration to identify where routes are expected to start
        route_completion_type:
          type: string
          description: Configuration to identify where routes are expected to end
        objective_fn:
          type: string
          description: Configuration to identify the metric used by the solver when
            generating optimized routes
        ops_group_home:
          description: Location of the Ops Group
          allOf:
            - $ref: "#/components/schemas/OpsGroupHome"
        default_shift_start_time:
          type: string
          description: Default time HH:mm when the shift starts for drivers
        default_shift_end_time:
          type: string
          description: Default time HH:mm when the shift ends for drivers
        route_capacity:
          type: integer
          description: Maximum number of orders in a route
        route_max_distance:
          type: integer
          description: Maximum distance in meters used by the resolver to constrain each
            route distance
        deleted:
          type: boolean
          description: Flag to include deleted ops groups
        deleted_at:
          type: string
          description: Timestamp at which the OpsGroup was deleted
        shift_availability_mode:
          type: string
          description: Flag to start/stop availability of all drivers based on the ops
            group shift
        order_tracking_mode:
          type: string
          nullable: true
          description: Order tracking mode associated with the ops-group
          deprecated: true
        schedule:
          type: array
          nullable: true
          description: List of schedules used for ops group workers for work assignment
            and shift tracking
          items:
            oneOf:
              - $ref: "#/components/schemas/OpsGroupDateSchedule"
              - $ref: "#/components/schemas/OpsGroupRecurringSchedule"
        order_tracking_automation:
          nullable: true
          description: A configuration object to enable/disable and customize automatic
            order tracking.
          allOf:
            - $ref: "#/components/schemas/OpsGroupOrderTrackingAutomation"
        work_status_automation:
          type: array
          nullable: true
          description: 'List of configuration object to enable/disable and customize
            automatic work status updation. If `null`, the default behavior is
            equivalent to: `{"type": "manual"}`.'
          items:
            $ref: "#/components/schemas/WorkStatusAutomation"
        app_config:
          type: object
          nullable: true
          description: Configuration specific to order's app
          additionalProperties:
            nullable: true
        operations_radius:
          type: integer
          nullable: true
          description: Maximum distance in meters from the ops group home within which
            order destinations are allowed
        enforce_operations_radius:
          type: boolean
          nullable: true
          description: Whether to enforce operations_radius validation at order creation
            time
      required:
        - ops_group_handle
        - ops_group_label
        - route_capacity
        - route_max_distance
        - shift_availability_mode
        - timezone
    CompleteRouteRequest:
      type: object
      properties: {}
    CompleteRouteResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - completed_at
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    ReassignRouteRequest:
      type: object
      properties:
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the new driver to whom the
            route needs to be assigned to
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the new worker to whom the
            route needs to be assigned to
        device_id:
          type: string
          nullable: true
          description: Unique identifier for the device of the worker to whom the route
            needs to be assigned to
    ReassignRouteResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - assigned_at
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    OptimiseRouteRequest:
      type: object
      properties: {}
    OptimiseRouteResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    UpdateOrderTaskRequest:
      type: object
      properties:
        label:
          type: string
          nullable: true
          description: Label of task to be updated.
        status:
          type: string
          enum:
            - ongoing
            - completed
            - cancelled
          nullable: true
          description: Status of task to be updated. Valid values are ongoing, completed,
            cancelled.
        description:
          type: string
          nullable: true
          description: Description of task to be updated. This will not update existing
            description.
        priority:
          type: string
          enum:
            - none
            - low
            - medium
            - high
          nullable: true
          description: Priority of task to be updated. Valid values are none, low, medium,
            high.
        metadata:
          type: object
          nullable: true
          description: Metadata to be updated for the task.
          additionalProperties:
            nullable: true
        attachments:
          type: array
          nullable: true
          minItems: 1
          maxItems: 10
          description: List of attachments in event, this will not delete existing
            attachments, only add new attachments to tasks
          items:
            oneOf:
              - $ref: "#/components/schemas/ImageAttachment"
              - $ref: "#/components/schemas/NoteAttachment"
              - $ref: "#/components/schemas/SignatureAttachment"
    CandidateWorkerRoute:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique Handle of Route
        index:
          type: integer
          description: Index at which the order can be added to the route
      required:
        - index
        - route_handle
    CandidateWorker:
      type: object
      properties:
        worker_handle:
          type: string
          description: Unique Handle of Worker
        profile:
          type: string
          nullable: true
          description: Profile of the worker
        order_start_location:
          nullable: true
          description: Start location of the order
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        route:
          nullable: true
          description: Candidate Route of the worker
          allOf:
            - $ref: "#/components/schemas/CandidateWorkerRoute"
      required:
        - worker_handle
    CandidateWorkersResponse:
      type: object
      properties:
        candidate_workers:
          type: array
          description: List of workers that are candidates for the order
          items:
            $ref: "#/components/schemas/CandidateWorker"
      required:
        - candidate_workers
    ResequenceOrdersInRouteRequest:
      type: object
      properties:
        orders:
          type: array
          description: List of orders in the updated sequence
          items:
            $ref: "#/components/schemas/OrderHandleInput"
      required:
        - orders
    ResequenceOrdersInRouteResponse:
      type: object
      properties:
        route_handle:
          type: string
          description: Unique identifier for the route
        status:
          type: string
          enum:
            - planned
            - assigned
            - tracking
            - completed
            - summarizing
          description: Current state of route
        version:
          type: integer
          description: Value indicating the latest updated state of the route
        created_at:
          type: string
          description: Timestamp at which the route was created
        embed_url:
          type: string
          description: Embeddable link that renders the route profile view
        orders:
          type: array
          description: List of orders to be fulfilled in the route
          items:
            $ref: "#/components/schemas/RouteOrder"
        created_by:
          nullable: true
          description: Source of the route creation. This can be a user, system, or any
            other entity responsible for creating the route.
          allOf:
            - $ref: "#/components/schemas/Source"
        ops_group_handle:
          type: string
          default: default
          description: URL safe unique identifier for the ops group to which the orders in
            the route are associated
        track_mode:
          type: string
          enum:
            - on_time
            - flex
            - full_shift
            - on_shift
            - pre_shift
          nullable: true
          description: Value representing whether the route is tracked in on_shift,
            pre_shift or full_shift mode
        plan_mode:
          type: string
          enum:
            - on_demand
            - scheduled
            - manual
          nullable: true
          description: Value indicating how the orders in the route were planned
        started_at:
          type: string
          nullable: true
          description: Timestamp at which the route tracking started
        assigned_at:
          type: string
          nullable: true
          description: Timestamp at which the route was assigned to a driver
        planned_at:
          type: string
          nullable: true
          description: Timestamp at which the orders were planned into this route
        completed_at:
          type: string
          nullable: true
          description: Timestamp at which the route was completed
        device_id:
          type: string
          nullable: true
          description: Unique identifier for a device
        driver_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the driver
          deprecated: true
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for the worker
        metadata:
          type: object
          nullable: true
          description: Additional customer provided information about the route
          additionalProperties:
            nullable: true
        region:
          nullable: true
          description: City, state, and country where the orders in the route are being
            fulfilled
          allOf:
            - $ref: "#/components/schemas/Region"
        distance:
          type: integer
          nullable: true
          description: Actual distance travelled by the driver to fulfill all orders in
            the route
        duration:
          type: integer
          nullable: true
          description: Actual time spent by the driver to fulfill all orders in the route
        estimate:
          nullable: true
          description: Object containing the estimate information for routes that have not
            been completed
          allOf:
            - $ref: "#/components/schemas/RouteDetailEstimate"
        plan_id:
          type: string
          nullable: true
          description: Unique identifier for the plan to which the route belongs to
        device_switch_mode:
          enum:
            - manual
            - login
            - closest_to_destination
          nullable: true
          description: Mode with which Route is expected to switch device
        candidate_devices:
          type: array
          nullable: true
          description: List of devices among which the route is expected to be tracked
          items:
            type: string
        completion_source:
          type: string
          nullable: true
          description: Source of the route completion
        scheduled_start_at:
          type: string
          nullable: true
          description: Scheduled start time of the route
        polyline:
          nullable: true
          description: LineString of actual coordinates traversed by the driver to fulfill
            the orders in the route
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: Location where the driver started tracking to fulfill the orders in
            the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: Location where the driver stopped tracking after completing all
            orders in the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        tracking_rate:
          type: number
          nullable: true
          description: Indicates the ratio of time tracked to expected tracking time of
            route. Values lie between 0.0 and 1.0
        time_to_first_event:
          type: number
          nullable: true
          description: Time in seconds to receive first event from device after tracking
            start
        time_to_first_location:
          type: number
          nullable: true
          description: Time in seconds to receive first location from device after
            tracking start
        completion_type:
          type: string
          enum:
            - end_at_last_order
            - return_to_start_location
            - manual
          nullable: true
          description: Configuration to identify where routes are expected to end
      required:
        - created_at
        - embed_url
        - orders
        - route_handle
        - status
        - version
    GetEstimatedRouteResponse:
      type: object
      properties:
        estimated_route_id:
          type: string
          description: The unique identifier for this estimated route
        polyline:
          nullable: true
          description: GeoJSON LineString representing the route polyline with [longitude,
            latitude] coordinates
          allOf:
            - $ref: "#/components/schemas/Polyline"
        start_location:
          nullable: true
          description: The starting location of the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        end_location:
          nullable: true
          description: The ending/destination location of the route
          allOf:
            - $ref: "#/components/schemas/LocationGeometryResponse"
        distance:
          type: integer
          nullable: true
          description: Total distance of the route in meters
        duration:
          type: integer
          nullable: true
          description: Estimated duration of the route in seconds
      required:
        - estimated_route_id
    DeleteAttachmentRequest:
      type: object
      properties: {}
    UpdateTasksDefinitionRequest:
      type: object
      properties:
        label:
          type: string
          nullable: true
          description: Name of the task definition.
        ops_group_handle:
          type: string
          nullable: true
          description: Ops group associated with this definition
        tasks:
          type: array
          nullable: true
          description: List of tasks part of this definition.
          items:
            $ref: "#/components/schemas/BaseOrderTask"
        metadata:
          type: object
          nullable: true
          description: Additional metadata for this definition.
          additionalProperties:
            nullable: true
    PlacesAggregate:
      type: object
      properties:
        count:
          type: integer
          description: Total number of places found
        count_circular_places:
          type: integer
          description: Number of places with circular geofence
        count_polygon_places:
          type: integer
          description: Number of places with polygon geofence
      required:
        - count
        - count_circular_places
        - count_polygon_places
    ScheduleItem:
      type: object
      properties:
        day_of_week:
          enum:
            - MONDAY
            - TUESDAY
            - WEDNESDAY
            - THURSDAY
            - FRIDAY
            - SATURDAY
            - SUNDAY
          description: Day of week
        start_time:
          type: string
          description: Start time (opening time) for the day
        end_time:
          type: string
          description: end_time (closing time) for the day
      required:
        - day_of_week
        - end_time
        - start_time
    AddressComponents:
      type: object
      properties:
        country:
          type: string
          nullable: true
          description: Country name or code
        state:
          type: string
          nullable: true
          description: State or province
        city:
          type: string
          nullable: true
          description: City or town
        postal_code:
          type: string
          nullable: true
          description: Postal/ZIP code
        street:
          type: string
          nullable: true
          description: Street address
    PolygonLocationGeometryResponse:
      type: object
      properties:
        type:
          enum:
            - Polygon
          description: Polygon Geometry type
        coordinates:
          type: array
          description: Location coordinates represented as list of list of [longitude,
            latitude].
          items:
            type: array
            items:
              type: array
              items:
                type: number
      required:
        - coordinates
        - type
    VisitDetectionConfig:
      type: object
      properties:
        worker_handle:
          type: string
          nullable: true
          description: Unique customer provided identifier for a worker
        metadata_filter:
          type: object
          nullable: true
          description: Metadata to detect the visit based on the key value pair provided
            with it.
          additionalProperties:
            nullable: true
    BoundingBox:
      type: object
      properties:
        geometry:
          description: Location
          allOf:
            - $ref: "#/components/schemas/PolygonLocationGeometryResponse"
        source:
          enum:
            - customer_provided
            - ht_generated
          description: Source which created this location
        skew:
          type: number
          description: Skew in inferred geofence, values can be between 0 and 1. 0 mean no
            skew, i.e. perfect overlap and 1 means no overlap
        area_ratio:
          type: number
          nullable: true
          description: Ratio of bounding box area to current geofence area
            (bounding_box/current)
        centroid_shift:
          type: number
          nullable: true
          description: Distance in meters between the centroid of current geofence and
            bounding box
      required:
        - geometry
        - skew
        - source
    PlaceListResponse:
      type: object
      properties:
        place_handle:
          type: string
          nullable: true
          description: Human friendly handle of places
        name:
          type: string
          nullable: true
          description: Human readable name of the place
        geometry:
          description: Location or geofence for this place
          oneOf:
            - $ref: "#/components/schemas/PointGeometry"
            - $ref: "#/components/schemas/PolygonGeometry"
        radius:
          type: integer
          nullable: true
          description: Radius of geofence in case geometry is a Point
        address:
          type: string
          nullable: true
          description: Address associated with the place
        timings:
          type: array
          nullable: true
          description: Expected (open) timings for this place
          items:
            $ref: "#/components/schemas/ScheduleItem"
        metadata:
          type: object
          nullable: true
          description: Metadata - any additional data in form of json
          additionalProperties:
            nullable: true
        closed_on:
          type: array
          nullable: true
          description: Dates when this place will be closed
          items:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Expected service/work time at this place
        detect_visits:
          type: boolean
          nullable: true
          deprecated: true
          description: "DEPRECATED: This field is no longer supported and will be removed
            in a future version. Setting detect_visits to true will result in an
            error. Visit detection functionality has been discontinued. Use
            Orders API to detect visits to shift destinations instead."
        geofence_id:
          type: string
          nullable: true
          deprecated: true
          description: UUID of the associated geofence.
        address_components:
          nullable: true
          description: "Structured address components for more accurate geocoding. Fields:
            country, state, city, postal_code, street."
          allOf:
            - $ref: "#/components/schemas/AddressComponents"
        place_type:
          type: string
          enum:
            - shop
            - house
            - restaurant
            - office
            - warehouse
            - hospital
            - mall
            - university
            - golf_course
            - stadium
            - airport
          nullable: true
          description: >-
            Type of place, used to restrict the maximum bounding box size during
            geocoding.


            | Type | Max Area | Approx. Size | Description |

            |------|----------|--------------|-------------|

            | shop | 5,000 m² | ~71m x 71m | Small retail shop or store |

            | house | 2,000 m² | ~45m x 45m | Residential house or apartment |

            | restaurant | 5,000 m² | ~71m x 71m | Restaurant, cafe, or eatery |

            | office | 10,000 m² | ~100m x 100m | Office building or coworking
            space |

            | warehouse | 50,000 m² | ~224m x 224m | Warehouse or distribution
            center |

            | hospital | 100,000 m² | ~316m x 316m | Hospital or large medical
            facility |

            | mall | 200,000 m² | ~447m x 447m | Shopping mall or large retail
            complex |

            | university | 5,000,000 m² | ~2.2km x 2.2km | University or large
            campus |

            | golf_course | 8,000,000 m² | ~2.8km x 2.8km | Golf course or large
            sports complex |

            | stadium | 1,000,000 m² | ~1.0km x 1.0km | Stadium or arena with
            parking |

            | airport | 8,000,000 m² | ~2.8km x 2.8km | Airport or airfield |


            If not specified, the default max area is 2,000,000 m² (~1.4km x
            1.4km).
        place_id:
          type: string
          format: uuid
          nullable: true
          description: Id of place
        last_updated:
          type: string
          nullable: true
          description: Time when this place was last updated
        order_count:
          type: integer
          nullable: true
          description: Order Count for this place
        inferred_geofences:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/InferredGeofence"
        inferred_geofences_skew:
          type: number
          nullable: true
          description: Skew in inferred geofence, values can be between 0 and 1. 0 mean no
            skew, i.e. perfect overlap and 1 means no overlap
        visit_detection_config:
          nullable: true
          description: Configuration as json to detect the visit based on the key value
            pair provided with it. This could be worker_handle or some logical
            grouping attached with worker's metadata.
          allOf:
            - $ref: "#/components/schemas/VisitDetectionConfig"
        inferred_geofence:
          nullable: true
          description: Inferred geofence as per the on ground activity on places
          allOf:
            - $ref: "#/components/schemas/InferredGeofence"
        bounding_box:
          nullable: true
          description: Bounding box for the location if the geometry of the place is a point
          allOf:
            - $ref: "#/components/schemas/BoundingBox"
        created_by:
          nullable: true
          description: Source details of who created this place
          allOf:
            - $ref: "#/components/schemas/Source"
        updated_by:
          nullable: true
          description: Source details of who last updated this place
          allOf:
            - $ref: "#/components/schemas/Source"
        locked_from_suggestions:
          type: boolean
          nullable: true
          description: Whether this place is locked from receiving future suggestions
        suggestion_applied:
          type: boolean
          nullable: true
          description: Whether a suggestion was applied to this place
        suggestion_applied_on:
          type: string
          nullable: true
          description: Timestamp when a suggestion was applied to this place
        has_pending_suggestion:
          type: boolean
          nullable: true
          description: Whether this place has a pending suggestion
        suggestion_not_applied_reason:
          type: string
          nullable: true
          description: Reason why suggestion was not applied, if applicable
        suggestions_reviewed_on:
          type: string
          nullable: true
          description: Timestamp when suggestions were last reviewed for this place
      required:
        - geometry
    PlacesResponse:
      type: object
      properties:
        aggregate:
          nullable: true
          description: Places aggregate results, if aggregate flag is passed in request
          allOf:
            - $ref: "#/components/schemas/PlacesAggregate"
        places:
          type: array
          nullable: true
          description: List of places
          items:
            $ref: "#/components/schemas/PlaceListResponse"
        pagination_token:
          type: string
          nullable: true
          description: Identifier used to fetch the next page
    PlaceLocation:
      type: object
      properties:
        geometry:
          description: Location
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
      required:
        - geometry
    PlaceCreateRequest:
      type: object
      properties:
        place_handle:
          type: string
          nullable: true
          description: Human friendly handle of places
        name:
          type: string
          nullable: true
          description: Human readable name of the place
        geometry:
          nullable: true
          description: Location or geofence for this place, if not provided, address will
            be used to infer an estimate square polygon geometry representing
            the address, the estimate can sometimes be not correct and must be
            reviewed and updated using the patch places api if necessary
          oneOf:
            - $ref: "#/components/schemas/PointGeometry"
            - $ref: "#/components/schemas/PolygonGeometry"
        radius:
          type: integer
          nullable: true
          description: Radius of geofence in case geometry is a Point
        address:
          type: string
          nullable: true
          description: Address associated with the place
        timings:
          type: array
          nullable: true
          description: Expected (open) timings for this place
          items:
            $ref: "#/components/schemas/ScheduleItem"
        metadata:
          type: object
          nullable: true
          description: Metadata - any additional data in form of json
          additionalProperties:
            nullable: true
        closed_on:
          type: array
          nullable: true
          description: Dates when this place will be closed
          items:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Expected service/work time at this place
        detect_visits:
          type: boolean
          nullable: true
          deprecated: true
          description: "DEPRECATED: This field is no longer supported and will be removed
            in a future version. Setting detect_visits to true will result in an
            error. Visit detection functionality has been discontinued. Use
            Orders API to detect visits to shift destinations instead."
        geofence_id:
          type: string
          nullable: true
          deprecated: true
          description: UUID of the associated geofence.
        address_components:
          nullable: true
          description: "Structured address components for more accurate geocoding. Fields:
            country, state, city, postal_code, street."
          allOf:
            - $ref: "#/components/schemas/AddressComponents"
        place_type:
          type: string
          enum:
            - shop
            - house
            - restaurant
            - office
            - warehouse
            - hospital
            - mall
            - university
            - golf_course
            - stadium
            - airport
          nullable: true
          description: >-
            Type of place, used to restrict the maximum bounding box size during
            geocoding.


            | Type | Max Area | Approx. Size | Description |

            |------|----------|--------------|-------------|

            | shop | 5,000 m² | ~71m x 71m | Small retail shop or store |

            | house | 2,000 m² | ~45m x 45m | Residential house or apartment |

            | restaurant | 5,000 m² | ~71m x 71m | Restaurant, cafe, or eatery |

            | office | 10,000 m² | ~100m x 100m | Office building or coworking
            space |

            | warehouse | 50,000 m² | ~224m x 224m | Warehouse or distribution
            center |

            | hospital | 100,000 m² | ~316m x 316m | Hospital or large medical
            facility |

            | mall | 200,000 m² | ~447m x 447m | Shopping mall or large retail
            complex |

            | university | 5,000,000 m² | ~2.2km x 2.2km | University or large
            campus |

            | golf_course | 8,000,000 m² | ~2.8km x 2.8km | Golf course or large
            sports complex |

            | stadium | 1,000,000 m² | ~1.0km x 1.0km | Stadium or arena with
            parking |

            | airport | 8,000,000 m² | ~2.8km x 2.8km | Airport or airfield |


            If not specified, the default max area is 2,000,000 m² (~1.4km x
            1.4km).
        parkings:
          type: array
          nullable: true
          description: Parkings around place
          items:
            $ref: "#/components/schemas/PlaceLocation"
        checkins:
          type: array
          nullable: true
          description: Checkin or Clockin locations at place
          items:
            $ref: "#/components/schemas/PlaceLocation"
        visit_detection_config:
          nullable: true
          description: Configuration as json to detect the visit based on the key value
            pair provided with it. This could be worker_handle or some logical
            grouping attached with worker's metadata.
          allOf:
            - $ref: "#/components/schemas/VisitDetectionConfig"
        locked_from_suggestions:
          type: boolean
          default: false
          nullable: true
          description: Whether this place is locked from receiving future suggestions
    PlaceLocationScore:
      type: object
      properties:
        geometry:
          description: Location
          allOf:
            - $ref: "#/components/schemas/PointLocationGeometryResponse"
        score:
          type: number
          description: Score indicating importance of this location
        source:
          enum:
            - customer_provided
            - ht_generated
          description: Source which created this location
      required:
        - geometry
        - score
        - source
    Area:
      type: object
      properties:
        geometry:
          description: Location
          allOf:
            - $ref: "#/components/schemas/PolygonLocationGeometryResponse"
        source:
          enum:
            - customer_provided
            - ht_generated
          description: Source which created this location
      required:
        - geometry
        - source
    SuggestionResponse:
      type: object
      properties:
        suggestion_id:
          type: string
          description: Unique identifier for the suggestion
        geometry:
          description: Suggested location or geofence for this place
          oneOf:
            - $ref: "#/components/schemas/PointGeometry"
            - $ref: "#/components/schemas/PolygonGeometry"
        radius:
          type: integer
          nullable: true
          description: Radius in meters for point geometry suggestions
        hex_id:
          type: string
          description: Hex ID associated with this suggestion
        applied_by:
          type: string
          nullable: true
          description: User who applied this suggestion
        applied_on:
          type: string
          nullable: true
          description: Time when this suggestion was applied
        suggested_by:
          type: string
          nullable: true
          description: User who suggested this geofence
        suggested_on:
          type: string
          description: Time when this suggestion was made
        order_handle:
          type: string
          nullable: true
          description: Order handle associated with this suggestion
        source:
          default: customer_provided
          enum:
            - ht_generated
            - customer_provided
          description: Source which created this suggestion
        type:
          type: string
          default: manual
          description: Type of suggestion (manual, inferred, bounding_box)
        skew:
          type: number
          nullable: true
          description: Skew between current geofence and suggestion, values can be between
            0 and 1. 0 means no skew (perfect overlap) and 1 means no overlap
        area_ratio:
          type: number
          nullable: true
          description: Ratio of suggested geometry area to current geofence area
            (suggested/current)
        centroid_shift:
          type: number
          nullable: true
          description: Distance in meters between the centroid of current geofence and
            suggestion
        inclusivity:
          type: string
          nullable: true
          description: More inclusivity means more loosely defined service area
      required:
        - geometry
        - hex_id
        - suggested_on
        - suggestion_id
    PlaceResponse:
      type: object
      properties:
        place_handle:
          type: string
          nullable: true
          description: Human friendly handle of places
        name:
          type: string
          nullable: true
          description: Human readable name of the place
        geometry:
          description: Location or geofence for this place
          oneOf:
            - $ref: "#/components/schemas/PointGeometry"
            - $ref: "#/components/schemas/PolygonGeometry"
        radius:
          type: integer
          nullable: true
          description: Radius of geofence in case geometry is a Point
        address:
          type: string
          nullable: true
          description: Address associated with the place
        timings:
          type: array
          nullable: true
          description: Expected (open) timings for this place
          items:
            $ref: "#/components/schemas/ScheduleItem"
        metadata:
          type: object
          nullable: true
          description: Metadata - any additional data in form of json
          additionalProperties:
            nullable: true
        closed_on:
          type: array
          nullable: true
          description: Dates when this place will be closed
          items:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Expected service/work time at this place
        detect_visits:
          type: boolean
          nullable: true
          deprecated: true
          description: "DEPRECATED: This field is no longer supported and will be removed
            in a future version. Setting detect_visits to true will result in an
            error. Visit detection functionality has been discontinued. Use
            Orders API to detect visits to shift destinations instead."
        geofence_id:
          type: string
          nullable: true
          deprecated: true
          description: UUID of the associated geofence.
        address_components:
          nullable: true
          description: "Structured address components for more accurate geocoding. Fields:
            country, state, city, postal_code, street."
          allOf:
            - $ref: "#/components/schemas/AddressComponents"
        place_type:
          type: string
          enum:
            - shop
            - house
            - restaurant
            - office
            - warehouse
            - hospital
            - mall
            - university
            - golf_course
            - stadium
            - airport
          nullable: true
          description: >-
            Type of place, used to restrict the maximum bounding box size during
            geocoding.


            | Type | Max Area | Approx. Size | Description |

            |------|----------|--------------|-------------|

            | shop | 5,000 m² | ~71m x 71m | Small retail shop or store |

            | house | 2,000 m² | ~45m x 45m | Residential house or apartment |

            | restaurant | 5,000 m² | ~71m x 71m | Restaurant, cafe, or eatery |

            | office | 10,000 m² | ~100m x 100m | Office building or coworking
            space |

            | warehouse | 50,000 m² | ~224m x 224m | Warehouse or distribution
            center |

            | hospital | 100,000 m² | ~316m x 316m | Hospital or large medical
            facility |

            | mall | 200,000 m² | ~447m x 447m | Shopping mall or large retail
            complex |

            | university | 5,000,000 m² | ~2.2km x 2.2km | University or large
            campus |

            | golf_course | 8,000,000 m² | ~2.8km x 2.8km | Golf course or large
            sports complex |

            | stadium | 1,000,000 m² | ~1.0km x 1.0km | Stadium or arena with
            parking |

            | airport | 8,000,000 m² | ~2.8km x 2.8km | Airport or airfield |


            If not specified, the default max area is 2,000,000 m² (~1.4km x
            1.4km).
        place_id:
          type: string
          format: uuid
          nullable: true
          description: Id of place
        last_updated:
          type: string
          nullable: true
          description: Time when this place was last updated
        order_count:
          type: integer
          nullable: true
          description: Order Count for this place
        inferred_geofences:
          type: array
          nullable: true
          items:
            $ref: "#/components/schemas/InferredGeofence"
        inferred_geofences_skew:
          type: number
          nullable: true
          description: Skew in inferred geofence, values can be between 0 and 1. 0 mean no
            skew, i.e. perfect overlap and 1 means no overlap
        visit_detection_config:
          nullable: true
          description: Configuration as json to detect the visit based on the key value
            pair provided with it. This could be worker_handle or some logical
            grouping attached with worker's metadata.
          allOf:
            - $ref: "#/components/schemas/VisitDetectionConfig"
        inferred_geofence:
          nullable: true
          description: Inferred geofence as per the on ground activity on places
          allOf:
            - $ref: "#/components/schemas/InferredGeofence"
        bounding_box:
          nullable: true
          description: Bounding box for the location if the geometry of the place is a point
          allOf:
            - $ref: "#/components/schemas/BoundingBox"
        created_by:
          nullable: true
          description: Source details of who created this place
          allOf:
            - $ref: "#/components/schemas/Source"
        updated_by:
          nullable: true
          description: Source details of who last updated this place
          allOf:
            - $ref: "#/components/schemas/Source"
        locked_from_suggestions:
          type: boolean
          nullable: true
          description: Whether this place is locked from receiving future suggestions
        suggestion_applied:
          type: boolean
          nullable: true
          description: Whether a suggestion was applied to this place
        suggestion_applied_on:
          type: string
          nullable: true
          description: Timestamp when a suggestion was applied to this place
        has_pending_suggestion:
          type: boolean
          nullable: true
          description: Whether this place has a pending suggestion
        suggestion_not_applied_reason:
          type: string
          nullable: true
          description: Reason why suggestion was not applied, if applicable
        suggestions_reviewed_on:
          type: string
          nullable: true
          description: Timestamp when suggestions were last reviewed for this place
        parkings:
          type: array
          nullable: true
          description: Parkings around place
          items:
            $ref: "#/components/schemas/PlaceLocationScore"
        checkins:
          type: array
          nullable: true
          description: Checkin or Clockin locations at place
          items:
            $ref: "#/components/schemas/PlaceLocationScore"
        service_areas:
          type: array
          nullable: true
          description: Service area where work usually happens in this place
          items:
            $ref: "#/components/schemas/Area"
        completions:
          type: array
          nullable: true
          description: locations where orders are marked complete
          items:
            $ref: "#/components/schemas/PlaceLocationScore"
        suggestions:
          type: array
          nullable: true
          description: Structured suggestions for this place
          items:
            $ref: "#/components/schemas/SuggestionResponse"
      required:
        - geometry
    GetPlaceSegmentsResponse:
      type: object
      properties:
        segments:
          type: array
          description: Array of place segments associated with the account
          items:
            type: string
        truncated:
          type: boolean
          description: Flag indicating if segments are truncated
      required:
        - segments
        - truncated
    PlacePatchRequest:
      type: object
      properties:
        place_handle:
          type: string
          nullable: true
          description: Human friendly handle of place
        name:
          type: string
          nullable: true
          description: Human readable name of the place
        geometry:
          nullable: true
          description: Location or geofence for this place
          oneOf:
            - $ref: "#/components/schemas/PointGeometry"
            - $ref: "#/components/schemas/PolygonGeometry"
        radius:
          type: integer
          nullable: true
          description: Radius of geofence in case geometry is a Point
        address:
          type: string
          nullable: true
          description: Address associated with the place
        timings:
          type: array
          nullable: true
          description: Expected (open) timings for this place
          items:
            $ref: "#/components/schemas/ScheduleItem"
        metadata:
          type: object
          nullable: true
          description: Metadata - any additional data in form of json
          additionalProperties:
            nullable: true
        closed_on:
          type: array
          nullable: true
          description: Dates when this place will be closed
          items:
            type: string
        expected_service_time:
          type: integer
          nullable: true
          description: Expected service/work time at this place
        detect_visits:
          type: boolean
          nullable: true
          deprecated: true
          description: "DEPRECATED: This field is no longer supported and will be removed
            in a future version. Setting detect_visits to true will result in an
            error. Visit detection functionality has been discontinued. Use
            Orders API to detect visits to shift destinations instead."
        geofence_id:
          type: string
          nullable: true
          deprecated: true
          description: UUID of the associated geofence.
        address_components:
          nullable: true
          description: "Structured address components for more accurate geocoding. Fields:
            country, state, city, postal_code, street."
          allOf:
            - $ref: "#/components/schemas/AddressComponents"
        place_type:
          type: string
          enum:
            - shop
            - house
            - restaurant
            - office
            - warehouse
            - hospital
            - mall
            - university
            - golf_course
            - stadium
            - airport
          nullable: true
          description: >-
            Type of place, used to restrict the maximum bounding box size during
            geocoding.


            | Type | Max Area | Approx. Size | Description |

            |------|----------|--------------|-------------|

            | shop | 5,000 m² | ~71m x 71m | Small retail shop or store |

            | house | 2,000 m² | ~45m x 45m | Residential house or apartment |

            | restaurant | 5,000 m² | ~71m x 71m | Restaurant, cafe, or eatery |

            | office | 10,000 m² | ~100m x 100m | Office building or coworking
            space |

            | warehouse | 50,000 m² | ~224m x 224m | Warehouse or distribution
            center |

            | hospital | 100,000 m² | ~316m x 316m | Hospital or large medical
            facility |

            | mall | 200,000 m² | ~447m x 447m | Shopping mall or large retail
            complex |

            | university | 5,000,000 m² | ~2.2km x 2.2km | University or large
            campus |

            | golf_course | 8,000,000 m² | ~2.8km x 2.8km | Golf course or large
            sports complex |

            | stadium | 1,000,000 m² | ~1.0km x 1.0km | Stadium or arena with
            parking |

            | airport | 8,000,000 m² | ~2.8km x 2.8km | Airport or airfield |


            If not specified, the default max area is 2,000,000 m² (~1.4km x
            1.4km).
        parkings:
          type: array
          nullable: true
          description: Parkings around place
          items:
            $ref: "#/components/schemas/PlaceLocation"
        checkins:
          type: array
          nullable: true
          description: Checkin or Clockin locations at place
          items:
            $ref: "#/components/schemas/PlaceLocation"
        visit_detection_config:
          nullable: true
          description: Configuration as json to detect the visit based on the key value
            pair provided with it. This could be worker_handle or some logical
            grouping attached with worker's metadata.
          allOf:
            - $ref: "#/components/schemas/VisitDetectionConfig"
        suggestion_used:
          type: boolean
          nullable: true
          description: If the geofence is applied using inferred geofence or bounding box
        suggestion_id:
          type: string
          nullable: true
          description: Id of the suggestion used to update the geofence
        locked_from_suggestions:
          type: boolean
          nullable: true
          description: Whether this place is locked from receiving future suggestions.
            defaults to true if suggestion_used is false
        suggestions_reviewed_on:
          type: string
          nullable: true
          description: Timestamp (ISO 8601) when suggestions were last reviewed for this
            place
    FieldChange:
      type: object
      properties:
        old:
          nullable: true
          description: Old value of the field
        new:
          nullable: true
          description: New value of the field
    PlaceHistoryEntry:
      type: object
      properties:
        audit_id:
          type: string
          format: uuid
          description: Unique identifier for this audit entry
        changed_at:
          type: string
          description: Timestamp when the change occurred
        changed_by:
          nullable: true
          description: Source information of who made the change
          allOf:
            - $ref: "#/components/schemas/Source"
        operation:
          type: string
          description: "Type of operation: INSERT, UPDATE, DELETE"
        changes:
          type: object
          description: Field-level changes with old and new values
          additionalProperties:
            $ref: "#/components/schemas/FieldChange"
      required:
        - audit_id
        - changed_at
        - changes
        - operation
    PlaceHistoryResponse:
      type: object
      properties:
        place_id:
          type: string
          format: uuid
          description: ID of the place
        place_handle:
          type: string
          description: Handle of the place
        history:
          type: array
          description: List of audit history entries
          items:
            $ref: "#/components/schemas/PlaceHistoryEntry"
        pagination_token:
          type: string
          nullable: true
          description: Identifier used to fetch the next page
      required:
        - history
        - place_handle
        - place_id
    SuggestionListResponse:
      type: object
      properties:
        suggestions:
          type: array
          description: List of suggestions
          items:
            $ref: "#/components/schemas/SuggestionResponse"
        pagination_token:
          type: string
          nullable: true
          description: Token to fetch the next page of suggestions
      required:
        - suggestions
    SuggestionCreateRequest:
      type: object
      properties:
        geometry:
          description: Suggested location or geofence for this place
          oneOf:
            - $ref: "#/components/schemas/PointGeometry"
            - $ref: "#/components/schemas/PolygonGeometry"
        radius:
          type: integer
          nullable: true
          description: Radius in meters for point geometry suggestions
        suggested_by:
          type: string
          nullable: true
          description: User who suggested this geofence
        order_handle:
          type: string
          nullable: true
          description: Order handle associated with this suggestion
      required:
        - geometry
    SuggestionApplyRequest:
      type: object
      properties:
        applied_by:
          type: string
          description: User who applied this suggestion
      required:
        - applied_by
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    TokenAuth:
      type: http
      scheme: bearer
