---
title: Stop Search
description: >-
  See the [Stops Search docs](/api/using-the-api/stop-search-api) for more
  information on formatting the filter string.
    The following fields are filterable:
    - `planId` - The ID of the plan stop is linked to in PlanId format (e.g. `plans/{planId}`)
    - `routeId` - The ID of the route stop is linked to in RouteId format (e.g. `routes/{routeId}`)
    - `type` - The type of the stop (e.g. `start`, `stop`, `end`)
    - `activity` - The activity performed at the stop (`delivery` or `pickup`)
    - `notes` - Notes associated with the stop
    - `orderInfo.sellerOrderId` - The order ID from the seller
    - `orderInfo.invoiceNumber` - The invoice number of the order
    - `orderInfo.sellerWebsite` - The website URL of the seller
    - `address.address` - The full address of the stop
    - `address.addressLineOne` - The first line of the stop address
    - `address.addressLineTwo` - The second line of the stop address
    - `address.latitude` - The latitude of the stop address in decimal degrees
    - `address.longitude` - The longitude of the stop address in decimal degrees
    - `address.placeId` - The Google Places identifier for the address
    - `address.countryCode` - The ISO country code for the address
    - `createdAt` - The timestamp when the stop was created (ISO 8601)
    - `arrivalAt` - The timestamp of the (estimated) arrival at the stop (ISO 8601)
    - `packageCount` - The number of packages to be delivered or picked up
    - `estimatedTravelDuration` - The estimated travel time to this stop from the previous one, in seconds
    - `estimatedTravelDistance` - The estimated travel distance to this stop from the previous one, in meters
    - `timing.estimatedAttemptDuration` - The estimated time spent at the stop to perform the activity, in seconds
    - `recipient.name` - The name of the recipient at the stop
    - `recipient.email` - The email address of the recipient
    - `recipient.phone` - The phone number of the recipient
    - `recipient.externalId` - An external identifier for the recipient
    - `deliveryInfo.state` - The current state of the delivery. See [DeliveryState](/docs/models/stop#deliverystate) for all supported values.
    - `deliveryInfo.attempted` - Whether a delivery attempt has been made
    - `deliveryInfo.succeeded` - Whether the delivery was successful
    - `deliveryInfo.recipientProvidedNotes` - Notes provided by the recipient for the driver
    - `deliveryInfo.driverProvidedInternalNotes` - Internal notes provided by the driver
    - `deliveryInfo.driverProvidedRecipientNotes` - Notes for the recipient provided by the driver
    - `deliveryInfo.signeeName` - The name of the person who signed for the delivery
    - `deliveryInfo.attemptedAt` - The timestamp when the delivery was attempted (ISO 8601)
    - `orderInfo.products` - The list of products included in the order
    - `orderInfo.sellerName` - The name of the seller
    - `paymentOnDelivery.amount` - The amount to be collected on delivery, in original units
    - `barcodes` - The list of barcodes associated with the stop
    - `allowedDrivers` - The drivers allowed to be assigned to the stop in DriverId format (e.g. `drivers/{driverId}`)
    - `packageLabel` - The label applied to the package(s)
    - `customProperties.*` - A custom property of the stop. Replace `*` with the custom property ID.

    The following fields are sortable:
    - `address.latitude`
    - `address.longitude`
    - `createdAt`
    - `arrivalAt`
    - `packageCount`
    - `estimatedTravelDuration`
    - `estimatedTravelDistance`
    - `timing.estimatedAttemptDuration`
    - `deliveryInfo.attemptedAt`
    - `paymentOnDelivery.amount`
url: /api/stops/searchStops
---

# Stop Search

`GET /stops:search`

````yaml
openapi: 3.1.0
info:
  title: Spoke API
  version: v1
servers:
  - url: https://api.spoke.com/public/v1
security:
  - BasicAuth: []
paths:
  /stops:search:
    get:
      operationId: searchStops
      summary: Stop Search
      tags:
        - Stops
      description: |
        See the [Stops Search docs](/api/using-the-api/stop-search-api) for more information on formatting the filter string.
          The following fields are filterable:
          - `planId` - The ID of the plan stop is linked to in PlanId format (e.g. `plans/{planId}`)
          - `routeId` - The ID of the route stop is linked to in RouteId format (e.g. `routes/{routeId}`)
          - `type` - The type of the stop (e.g. `start`, `stop`, `end`)
          - `activity` - The activity performed at the stop (`delivery` or `pickup`)
          - `notes` - Notes associated with the stop
          - `orderInfo.sellerOrderId` - The order ID from the seller
          - `orderInfo.invoiceNumber` - The invoice number of the order
          - `orderInfo.sellerWebsite` - The website URL of the seller
          - `address.address` - The full address of the stop
          - `address.addressLineOne` - The first line of the stop address
          - `address.addressLineTwo` - The second line of the stop address
          - `address.latitude` - The latitude of the stop address in decimal degrees
          - `address.longitude` - The longitude of the stop address in decimal degrees
          - `address.placeId` - The Google Places identifier for the address
          - `address.countryCode` - The ISO country code for the address
          - `createdAt` - The timestamp when the stop was created (ISO 8601)
          - `arrivalAt` - The timestamp of the (estimated) arrival at the stop (ISO 8601)
          - `packageCount` - The number of packages to be delivered or picked up
          - `estimatedTravelDuration` - The estimated travel time to this stop from the previous one, in seconds
          - `estimatedTravelDistance` - The estimated travel distance to this stop from the previous one, in meters
          - `timing.estimatedAttemptDuration` - The estimated time spent at the stop to perform the activity, in seconds
          - `recipient.name` - The name of the recipient at the stop
          - `recipient.email` - The email address of the recipient
          - `recipient.phone` - The phone number of the recipient
          - `recipient.externalId` - An external identifier for the recipient
          - `deliveryInfo.state` - The current state of the delivery. See [DeliveryState](/docs/models/stop#deliverystate) for all supported values.
          - `deliveryInfo.attempted` - Whether a delivery attempt has been made
          - `deliveryInfo.succeeded` - Whether the delivery was successful
          - `deliveryInfo.recipientProvidedNotes` - Notes provided by the recipient for the driver
          - `deliveryInfo.driverProvidedInternalNotes` - Internal notes provided by the driver
          - `deliveryInfo.driverProvidedRecipientNotes` - Notes for the recipient provided by the driver
          - `deliveryInfo.signeeName` - The name of the person who signed for the delivery
          - `deliveryInfo.attemptedAt` - The timestamp when the delivery was attempted (ISO 8601)
          - `orderInfo.products` - The list of products included in the order
          - `orderInfo.sellerName` - The name of the seller
          - `paymentOnDelivery.amount` - The amount to be collected on delivery, in original units
          - `barcodes` - The list of barcodes associated with the stop
          - `allowedDrivers` - The drivers allowed to be assigned to the stop in DriverId format (e.g. `drivers/{driverId}`)
          - `packageLabel` - The label applied to the package(s)
          - `customProperties.*` - A custom property of the stop. Replace `*` with the custom property ID.

          The following fields are sortable:
          - `address.latitude`
          - `address.longitude`
          - `createdAt`
          - `arrivalAt`
          - `packageCount`
          - `estimatedTravelDuration`
          - `estimatedTravelDistance`
          - `timing.estimatedAttemptDuration`
          - `deliveryInfo.attemptedAt`
          - `paymentOnDelivery.amount`
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 255
          in: query
          name: keyword
          required: false
          description: Keywords to include in the search. These will be applied to all applicable text fields using a fuzzy matching.
        - schema:
            type: string
            minLength: 1
            maxLength: 2048
          in: query
          name: filter
          required: false
          description: The filter to apply. This is used to include/exclude stops form the search.
        - schema:
            type: string
          in: query
          name: pageToken
          required: false
          description: The page token.
        - schema:
            default: 20
            type: integer
            exclusiveMinimum: 1
            exclusiveMaximum: 20
          in: query
          name: maxPageSize
          required: false
          description: The max page size.
        - schema:
            type: string
          in: query
          name: sortField
          required: false
          description: The sort field.
        - schema:
            default: asc
            type: string
            enum:
              - asc
              - desc
          in: query
          name: sortOrder
          required: false
          description: The sort direction.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  stops:
                    type: array
                    items:
                      oneOf:
                        - type: object
                          properties:
                            type:
                              type: string
                              description: The type of the stop.
                              enum:
                                - stop
                            stop:
                              allOf:
                                - $ref: "#/components/schemas/stopSchema"
                              description: The stop.
                          required:
                            - type
                            - stop
                        - type: object
                          properties:
                            type:
                              type: string
                              description: The type of the stop.
                              enum:
                                - unassignedStop
                            unassignedStop:
                              allOf:
                                - $ref: "#/components/schemas/unassignedStopSchema"
                              description: The unassigned stop.
                          required:
                            - type
                            - unassignedStop
                    description: The stops list.
                  nextPageToken:
                    description: The next page token.
                    type:
                      - "null"
                      - string
                required:
                  - stops
                  - nextPageToken
                definitions:
                  stopSchema:
                    type: object
                    properties:
                      id:
                        type: string
                        pattern: ^plans\/[a-zA-Z0-9---_]{1,50}\/stops\/[a-zA-Z0-9---_]{1,50}$
                        description: The id of the stop, in the format `plans/<id>/stops/<id>`.
                      address:
                        type: object
                        properties:
                          address:
                            type: string
                            description: The address of the stop.
                          addressLineOne:
                            type: string
                            description: The first line of the address.
                          addressLineTwo:
                            type: string
                            description: The second line of the address.
                          latitude:
                            anyOf:
                              - type: number
                                minimum: -90
                                maximum: 90
                              - type: "null"
                            description: The latitude of the address in decimal degrees.
                          longitude:
                            anyOf:
                              - type: number
                                minimum: -180
                                maximum: 180
                              - type: "null"
                            description: The longitude of the address in decimal degrees.
                          placeId:
                            description: The identifier of the place corresponding to this stop on Google Places
                            type:
                              - string
                              - "null"
                          placeTypes:
                            type: array
                            items:
                              type: string
                            description: Array of strings that is provided by the Google AutoCompleteAPI
                        required:
                          - address
                          - addressLineOne
                          - addressLineTwo
                          - latitude
                          - longitude
                          - placeId
                          - placeTypes
                        additionalProperties: false
                        description: The address of the stop.
                      barcodes:
                        type: array
                        items:
                          type: string
                        description: List of Barcode IDs associated with the stop.
                      allowedDrivers:
                        type: array
                        items:
                          type: string
                          pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
                        description: The driver IDs that can be assigned to this stop
                      estimatedTravelDuration:
                        description: Estimated time that the driver will take to arrive at this stop from the previous stop in seconds.
                        type:
                          - number
                          - "null"
                      estimatedTravelDistance:
                        description: The distance in meters between the previous stop and this stop.
                        type:
                          - number
                          - "null"
                      notes:
                        description: Notes for the stop.
                        type:
                          - string
                          - "null"
                      packageCount:
                        description: The number of packages.
                        type:
                          - number
                          - "null"
                      weight:
                        anyOf:
                          - type: object
                            properties:
                              amount:
                                type: number
                                minimum: 0
                                description: The weight amount for this stop.
                              unit:
                                type: string
                                enum:
                                  - kilogram
                                  - pound
                                  - metric-ton
                                description: The weight unit in which the amount is specified (defined at team's capacity unit).
                            required:
                              - amount
                              - unit
                            additionalProperties: false
                            description: Weight information for the stop.
                          - type: "null"
                      type:
                        type: string
                        enum:
                          - start
                          - stop
                          - end
                        description: The type of the stop. `start` is the first stop of the route, `stop` is a stop in the middle of the route, and `end` is the last stop of the route.
                      packageLabel:
                        description: The label of the package.
                        type:
                          - string
                          - "null"
                      stopPosition:
                        description: The position of the stop in the route.
                        type:
                          - number
                          - "null"
                      trackingLink:
                        description: The recipient tracking link.
                        type:
                          - string
                          - "null"
                      webAppLink:
                        type: string
                        description: The web app link.
                      orderInfo:
                        type: object
                        properties:
                          products:
                            type: array
                            items:
                              type: string
                            description: The products of the stop.
                          invoiceNumber:
                            description: Invoice number associated with the order.
                            type:
                              - string
                              - "null"
                          sellerName:
                            description: Name of the seller where the order is from.
                            type:
                              - string
                              - "null"
                          sellerOrderId:
                            description: Id of the seller where the order is from.
                            type:
                              - string
                              - "null"
                          sellerWebsite:
                            description: Website of the seller where the order is from.
                            type:
                              - string
                              - "null"
                        required:
                          - products
                          - invoiceNumber
                          - sellerName
                          - sellerOrderId
                          - sellerWebsite
                        additionalProperties: false
                        description: The order information of the stop.
                      placeInVehicle:
                        anyOf:
                          - type: object
                            properties:
                              x:
                                anyOf:
                                  - type: string
                                    enum:
                                      - left
                                      - right
                                  - type: "null"
                                description: The x position of the package.
                              y:
                                anyOf:
                                  - type: string
                                    enum:
                                      - front
                                      - back
                                      - middle
                                  - type: "null"
                                description: The y position of the package.
                              z:
                                anyOf:
                                  - type: string
                                    enum:
                                      - floor
                                      - shelf
                                  - type: "null"
                                description: The z position of the package.
                            required:
                              - x
                              - y
                              - z
                            additionalProperties: false
                            description: The position of the package in the vehicle.
                          - type: "null"
                      recipient:
                        type: object
                        properties:
                          name:
                            description: The name of the recipient.
                            type:
                              - string
                              - "null"
                          email:
                            description: The email of the recipient.
                            type:
                              - string
                              - "null"
                          phone:
                            description: The phone of the recipient.
                            type:
                              - string
                              - "null"
                          externalId:
                            description: The external id of the recipient.
                            type:
                              - string
                              - "null"
                        required:
                          - name
                          - email
                          - phone
                          - externalId
                        additionalProperties: false
                        description: The recipient of the stop.
                      activity:
                        default: delivery
                        type: string
                        enum:
                          - delivery
                          - pickup
                      deliveryInfo:
                        anyOf:
                          - type: object
                            properties:
                              attempted:
                                type: boolean
                                description: Whether the stop was attempted.
                              attemptedAt:
                                description: When the stop was attempted in seconds since epoch.
                                type:
                                  - number
                                  - "null"
                              timeAtStopInfo:
                                oneOf:
                                  - type: object
                                    properties:
                                      status:
                                        type: string
                                        enum:
                                          - available
                                      value:
                                        type: object
                                        properties:
                                          arrivedAt:
                                            description: When the driver arrived at the stop in seconds since epoch.
                                            type:
                                              - number
                                              - "null"
                                          departedAt:
                                            description: When the driver departed from the stop in seconds since epoch.
                                            type:
                                              - number
                                              - "null"
                                          isEstimated:
                                            description: Whether the time at stop was estimated rather than directly measured.
                                            type:
                                              - boolean
                                              - "null"
                                        required:
                                          - arrivedAt
                                          - departedAt
                                          - isEstimated
                                        additionalProperties: false
                                        description: Grouped time-at-stop data.
                                    required:
                                      - status
                                      - value
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      status:
                                        type: string
                                        enum:
                                          - restricted
                                      requiredFeature:
                                        type: string
                                      upgradeUrl:
                                        type: string
                                      restrictionCode:
                                        type: string
                                        enum:
                                          - subscription_not_supported
                                    required:
                                      - status
                                    additionalProperties: false
                                  - type: object
                                    properties:
                                      status:
                                        type: string
                                        enum:
                                          - pending
                                      pendingReason:
                                        type: string
                                        enum:
                                          - not_yet_arrived
                                    required:
                                      - status
                                    additionalProperties: false
                              attemptedLocation:
                                anyOf:
                                  - type: object
                                    properties:
                                      latitude:
                                        type: number
                                        description: The latitude of the location.
                                      longitude:
                                        type: number
                                        description: The longitude of the location.
                                    required:
                                      - latitude
                                      - longitude
                                    additionalProperties: false
                                    description: A location.
                                  - type: "null"
                                description: Where the stop was attempted.
                              driverProvidedInternalNotes:
                                description: Internal notes provided by the driver.
                                type:
                                  - string
                                  - "null"
                              driverProvidedRecipientNotes:
                                description: Recipient notes provided by the driver.
                                type:
                                  - string
                                  - "null"
                              photoUrls:
                                type: array
                                items:
                                  type: string
                                description: URLs of proof of delivery photos.
                              recipientProvidedNotes:
                                description: Notes from recipient
                                type:
                                  - string
                                  - "null"
                              signatureUrl:
                                description: URL of the signature.
                                type:
                                  - string
                                  - "null"
                              signeeName:
                                description: Name of the signee.
                                type:
                                  - string
                                  - "null"
                              succeeded:
                                type: boolean
                                description: Whether the stop was succeeded.
                              state:
                                type: string
                                enum:
                                  - delivered_to_recipient
                                  - delivered_to_third_party
                                  - delivered_to_mailbox
                                  - delivered_to_safe_place
                                  - delivered_to_pickup_point
                                  - delivered_other
                                  - picked_up_from_customer
                                  - picked_up_unmanned
                                  - picked_up_from_locker
                                  - picked_up_other
                                  - failed_not_home
                                  - failed_cant_find_address
                                  - failed_no_parking
                                  - failed_no_time
                                  - failed_package_not_available
                                  - failed_other
                                  - failed_missing_required_proof
                                  - failed_payment_not_received
                                  - unattempted
                                description: The state of the delivery.
                            required:
                              - attempted
                              - attemptedAt
                              - timeAtStopInfo
                              - attemptedLocation
                              - driverProvidedInternalNotes
                              - driverProvidedRecipientNotes
                              - photoUrls
                              - recipientProvidedNotes
                              - signatureUrl
                              - signeeName
                              - succeeded
                              - state
                            additionalProperties: false
                            description: The delivery information of the stop.
                          - type: "null"
                      paymentOnDelivery:
                        anyOf:
                          - type: object
                            properties:
                              amount:
                                anyOf:
                                  - type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                  - type: "null"
                                description: The amount *in minor units* (e.g. cents) to be collected upon delivery.
                              currency:
                                type: string
                                description: The payment's currency in ISO 4217 standard.
                            required:
                              - amount
                              - currency
                            additionalProperties: false
                            description: The payment due upon delivery also known as "Cash on Delivery".
                          - type: "null"
                      proofOfAttemptRequirements:
                        type: object
                        properties:
                          enabled:
                            description: Whether the proof of attempt is enabled.This only works if the team subscription has access to proof of delivery
                            type:
                              - boolean
                              - "null"
                        required:
                          - enabled
                        additionalProperties: false
                        description: The proof of attempt requirements of the stop.
                      plan:
                        type: string
                        pattern: ^plans\/[a-zA-Z0-9---_]{1,50}$
                        description: The id of the plan, in the format `plans/<id>`.
                      route:
                        anyOf:
                          - type: object
                            properties:
                              id:
                                type: string
                                pattern: ^routes\/[a-zA-Z0-9---_]{1,50}$
                                description: The id of the route, in the format `routes/<id>`.
                              title:
                                type: string
                                description: The title of the route.
                              stopCount:
                                type: number
                                description: The number of stops in the route.
                              driver:
                                anyOf:
                                  - type: string
                                    pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
                                  - type: "null"
                                description: The id of the driver.
                              state:
                                anyOf:
                                  - type: object
                                    properties:
                                      completed:
                                        type: boolean
                                        description: Whether the route is completed.
                                      completedAt:
                                        description: The timestamp the route was completed at.
                                        type:
                                          - number
                                          - "null"
                                      distributed:
                                        type: boolean
                                        description: Whether the route is distributed.
                                      distributedAt:
                                        description: The timestamp the route was distributed at.
                                        type:
                                          - number
                                          - "null"
                                      notifiedRecipients:
                                        type: boolean
                                        description: Whether the recipients were notified.
                                      notifiedRecipientsAt:
                                        description: The timestamp the recipients were notified at.
                                        type:
                                          - number
                                          - "null"
                                      started:
                                        type: boolean
                                        description: Whether the route is started.
                                      startedAt:
                                        description: The timestamp the route was started at.
                                        type:
                                          - number
                                          - "null"
                                    required:
                                      - completed
                                      - completedAt
                                      - distributed
                                      - distributedAt
                                      - notifiedRecipients
                                      - notifiedRecipientsAt
                                      - started
                                      - startedAt
                                    additionalProperties: false
                                    description: The state of a route.
                                  - type: "null"
                                description: The state of the route.
                              plan:
                                anyOf:
                                  - type: string
                                    pattern: ^plans\/[a-zA-Z0-9---_]{1,50}$
                                  - type: "null"
                                description: The id of the related plan.
                            required:
                              - id
                              - title
                              - stopCount
                              - driver
                              - state
                              - plan
                            additionalProperties: false
                            description: A route.
                          - type: "null"
                        description: The route of the stop, if any.
                      eta:
                        oneOf:
                          - type: object
                            properties:
                              status:
                                type: string
                                enum:
                                  - available
                              value:
                                type: object
                                properties:
                                  estimatedArrivalAt:
                                    type: number
                                    description: The estimated time in seconds since epoch.
                                  estimatedLatestArrivalAt:
                                    type: number
                                    description: The latest estimated time in seconds since epoch.
                                  estimatedEarliestArrivalAt:
                                    type: number
                                    description: The earliest estimated time in seconds since epoch.
                                required:
                                  - estimatedArrivalAt
                                  - estimatedLatestArrivalAt
                                  - estimatedEarliestArrivalAt
                                additionalProperties: false
                                description: The estimated time of arrival data of the stop.
                            required:
                              - status
                              - value
                            additionalProperties: false
                          - type: object
                            properties:
                              status:
                                type: string
                                enum:
                                  - restricted
                              requiredFeature:
                                type: string
                              upgradeUrl:
                                type: string
                              restrictionCode:
                                type: string
                                enum:
                                  - subscription_not_supported
                            required:
                              - status
                            additionalProperties: false
                          - type: object
                            properties:
                              status:
                                type: string
                                enum:
                                  - pending
                              pendingReason:
                                type: string
                                enum:
                                  - not_optimized
                            required:
                              - status
                            additionalProperties: false
                      timing:
                        type: object
                        properties:
                          timeWindows:
                            maxItems: 2
                            type: array
                            items:
                              type: object
                              properties:
                                earliestAttemptTime:
                                  anyOf:
                                    - type: object
                                      properties:
                                        hour:
                                          type: integer
                                          minimum: 0
                                          maximum: 23
                                          description: Hour of the day
                                        minute:
                                          type: integer
                                          minimum: 0
                                          maximum: 59
                                          description: Minute of the hour
                                      required:
                                        - hour
                                        - minute
                                      additionalProperties: false
                                      description: Time of day in hours and minutes. Uses a 24 hour clock.
                                    - type: "null"
                                  description: Earliest attempt time in this window. Null means there is no earliest time constraint.
                                latestAttemptTime:
                                  anyOf:
                                    - type: object
                                      properties:
                                        hour:
                                          type: integer
                                          minimum: 0
                                          maximum: 23
                                          description: Hour of the day
                                        minute:
                                          type: integer
                                          minimum: 0
                                          maximum: 59
                                          description: Minute of the hour
                                      required:
                                        - hour
                                        - minute
                                      additionalProperties: false
                                      description: Time of day in hours and minutes. Uses a 24 hour clock.
                                    - type: "null"
                                  description: Latest attempt time in this window. Null means there is no latest time constraint.
                              required:
                                - earliestAttemptTime
                                - latestAttemptTime
                              additionalProperties: false
                              description: An arrival window for the stop.
                            description: Ordered arrival windows for this stop.
                          estimatedAttemptDuration:
                            description: Time that the driver estimates to spend on the stop to do his job (deliver a parcel, visit a client, etc) in seconds.
                            type:
                              - number
                              - "null"
                          earliestAttemptTime:
                            anyOf:
                              - type: object
                                properties:
                                  hour:
                                    type: integer
                                    minimum: 0
                                    maximum: 23
                                    description: Hour of the day
                                  minute:
                                    type: integer
                                    minimum: 0
                                    maximum: 59
                                    description: Minute of the hour
                                required:
                                  - hour
                                  - minute
                                additionalProperties: false
                                description: Time of day in hours and minutes. Uses a 24 hour clock.
                              - type: "null"
                            description: The earliest time that the driver should arrive at the stop
                          latestAttemptTime:
                            anyOf:
                              - type: object
                                properties:
                                  hour:
                                    type: integer
                                    minimum: 0
                                    maximum: 23
                                    description: Hour of the day
                                  minute:
                                    type: integer
                                    minimum: 0
                                    maximum: 59
                                    description: Minute of the hour
                                required:
                                  - hour
                                  - minute
                                additionalProperties: false
                                description: Time of day in hours and minutes. Uses a 24 hour clock.
                              - type: "null"
                            description: The latest time that the driver should arrive at the stop.
                        required:
                          - timeWindows
                          - estimatedAttemptDuration
                          - earliestAttemptTime
                          - latestAttemptTime
                        additionalProperties: false
                        description: The timing data of the stop.
                      optimizationOrder:
                        default: default
                        type: string
                        enum:
                          - first
                          - last
                          - default
                      customProperties:
                        anyOf:
                          - type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              type:
                                - string
                                - "null"
                          - type: "null"
                        description: Custom properties of the stop, can be used to store additional information.
                      clientId:
                        description: The associated Client ID of the Spoke Connect
                        type:
                          - string
                          - "null"
                      serviceInfo:
                        oneOf:
                          - type: object
                            properties:
                              status:
                                type: string
                                enum:
                                  - available
                              value:
                                anyOf:
                                  - type: object
                                    properties:
                                      identifier:
                                        type: string
                                        description: The service offering identifier, as configured in Spoke Dispatch, captured at assignment time. Not currently discoverable through the public API.
                                      name:
                                        type: string
                                        description: The human-readable service name.
                                      slaStartsAt:
                                        type: number
                                        description: The SLA start time in seconds since epoch.
                                      slaDueDate:
                                        type: object
                                        properties:
                                          day:
                                            type: integer
                                            minimum: 1
                                            maximum: 31
                                            description: The day of the date.
                                          month:
                                            type: integer
                                            minimum: 1
                                            maximum: 12
                                            description: The month of the date.
                                          year:
                                            type: integer
                                            minimum: 2000
                                            maximum: 2100
                                            description: The year of the date.
                                        required:
                                          - day
                                          - month
                                          - year
                                        additionalProperties: false
                                        description: The computed SLA due date in the team's timezone.
                                      slaDueTime:
                                        anyOf:
                                          - type: object
                                            properties:
                                              hour:
                                                type: integer
                                                minimum: 0
                                                maximum: 23
                                                description: Hour of the day
                                              minute:
                                                type: integer
                                                minimum: 0
                                                maximum: 59
                                                description: Minute of the hour
                                            required:
                                              - hour
                                              - minute
                                            additionalProperties: false
                                            description: Time of day in hours and minutes. Uses a 24 hour clock.
                                          - type: "null"
                                        description: SLA due time-of-day in the team's timezone, null for day-level SLA.
                                      deliveryHorizon:
                                        type: object
                                        properties:
                                          unit:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - days
                                                  - hours
                                              - type: string
                                            description: "The time unit of the delivery horizon. Known: `days`, `hours`."
                                          value:
                                            type: number
                                            description: The number of time units in the delivery horizon.
                                        required:
                                          - unit
                                          - value
                                        additionalProperties: false
                                        description: The delivery horizon for this service.
                                      price:
                                        type: object
                                        properties:
                                          value:
                                            type: number
                                            description: Price in minor currency units (e.g. cents).
                                          currency:
                                            anyOf:
                                              - type: string
                                                enum:
                                                  - AED
                                                  - ARS
                                                  - AUD
                                                  - BRL
                                                  - CAD
                                                  - CHF
                                                  - CLP
                                                  - CNY
                                                  - COP
                                                  - DKK
                                                  - EGP
                                                  - EUR
                                                  - GBP
                                                  - HKD
                                                  - HUF
                                                  - ILS
                                                  - INR
                                                  - JPY
                                                  - KRW
                                                  - MYR
                                                  - MXN
                                                  - NOK
                                                  - NZD
                                                  - PEN
                                                  - RON
                                                  - RUB
                                                  - SAR
                                                  - SEK
                                                  - SGD
                                                  - TRY
                                                  - USD
                                                  - UYU
                                                  - ZAR
                                              - type: string
                                            description: 3-letter ISO 4217 currency code.
                                        required:
                                          - value
                                          - currency
                                        additionalProperties: false
                                        description: Price for this service at assignment time.
                                      hasPaymentOnDelivery:
                                        type: boolean
                                        description: Whether cash on delivery is enabled via the service.
                                      definedAt:
                                        type: number
                                        description: When the service was assigned in seconds since epoch.
                                    required:
                                      - identifier
                                      - name
                                      - slaStartsAt
                                      - slaDueDate
                                      - slaDueTime
                                      - deliveryHorizon
                                      - price
                                      - hasPaymentOnDelivery
                                      - definedAt
                                    additionalProperties: false
                                    description: Service offering data when a service is assigned to the stop.
                                  - type: object
                                    properties:
                                      identifier:
                                        type: "null"
                                        description: Null indicates no service offering is linked.
                                      slaStartsAt:
                                        type: number
                                        description: The SLA start time in seconds since epoch.
                                    required:
                                      - identifier
                                      - slaStartsAt
                                    additionalProperties: false
                                    description: Service data when only an SLA start time is set.
                                description: Service offering data for this stop.
                            required:
                              - status
                              - value
                            additionalProperties: false
                          - type: object
                            properties:
                              status:
                                type: string
                                enum:
                                  - empty
                            required:
                              - status
                            additionalProperties: false
                          - type: object
                            properties:
                              status:
                                type: string
                                enum:
                                  - restricted
                              requiredFeature:
                                type: string
                              upgradeUrl:
                                type: string
                              restrictionCode:
                                type: string
                                enum:
                                  - subscription_not_supported
                            required:
                              - status
                            additionalProperties: false
                        description: Service offering data for this stop.
                    required:
                      - id
                      - address
                      - barcodes
                      - allowedDrivers
                      - estimatedTravelDuration
                      - estimatedTravelDistance
                      - notes
                      - packageCount
                      - weight
                      - type
                      - packageLabel
                      - stopPosition
                      - trackingLink
                      - webAppLink
                      - orderInfo
                      - placeInVehicle
                      - recipient
                      - deliveryInfo
                      - paymentOnDelivery
                      - proofOfAttemptRequirements
                      - plan
                      - route
                      - eta
                      - timing
                      - customProperties
                      - clientId
                      - serviceInfo
                    additionalProperties: false
                    description: A stop of a plan, can be related to a route.
                  unassignedStopSchema:
                    type: object
                    properties:
                      id:
                        type: string
                        pattern: ^unassignedStops\/[a-zA-Z0-9---_]{1,50}$
                        description: The id of the unassigned stop, in the format `unassignedStops/<id>`.
                      depot:
                        type: string
                        pattern: ^depots\/[a-zA-Z0-9---_]{1,50}$
                        description: The depot that this unassigned stop belongs to.
                      address:
                        type: object
                        properties:
                          address:
                            type: string
                            description: The address of the stop.
                          addressLineOne:
                            type: string
                            description: The first line of the address.
                          addressLineTwo:
                            type: string
                            description: The second line of the address.
                          latitude:
                            anyOf:
                              - type: number
                                minimum: -90
                                maximum: 90
                              - type: "null"
                            description: The latitude of the address in decimal degrees.
                          longitude:
                            anyOf:
                              - type: number
                                minimum: -180
                                maximum: 180
                              - type: "null"
                            description: The longitude of the address in decimal degrees.
                          placeId:
                            description: The identifier of the place corresponding to this stop on Google Places
                            type:
                              - string
                              - "null"
                          placeTypes:
                            type: array
                            items:
                              type: string
                            description: Array of strings that is provided by the Google AutoCompleteAPI
                        required:
                          - address
                          - addressLineOne
                          - addressLineTwo
                          - latitude
                          - longitude
                          - placeId
                          - placeTypes
                        additionalProperties: false
                        description: The address of the stop.
                      barcodes:
                        type: array
                        items:
                          type: string
                        description: List of Barcode IDs associated with the stop.
                      allowedDrivers:
                        type: array
                        items:
                          type: string
                          pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
                        description: The driver IDs that can be assigned to this stop.
                      notes:
                        description: Notes for the stop.
                        type:
                          - string
                          - "null"
                      packageCount:
                        description: The number of packages.
                        type:
                          - number
                          - "null"
                      weight:
                        anyOf:
                          - type: object
                            properties:
                              amount:
                                type: number
                                minimum: 0
                                description: The weight amount for this stop.
                              unit:
                                type: string
                                enum:
                                  - kilogram
                                  - pound
                                  - metric-ton
                                description: The weight unit in which the amount is specified (defined at team's capacity unit).
                            required:
                              - amount
                              - unit
                            additionalProperties: false
                            description: Weight information for the stop.
                          - type: "null"
                      orderInfo:
                        type: object
                        properties:
                          products:
                            type: array
                            items:
                              type: string
                            description: The products of the stop.
                          invoiceNumber:
                            description: Invoice number associated with the order.
                            type:
                              - string
                              - "null"
                          sellerName:
                            description: Name of the seller where the order is from.
                            type:
                              - string
                              - "null"
                          sellerOrderId:
                            description: Id of the seller where the order is from.
                            type:
                              - string
                              - "null"
                          sellerWebsite:
                            description: Website of the seller where the order is from.
                            type:
                              - string
                              - "null"
                        required:
                          - products
                          - invoiceNumber
                          - sellerName
                          - sellerOrderId
                          - sellerWebsite
                        additionalProperties: false
                        description: The order information of the stop.
                      recipient:
                        type: object
                        properties:
                          name:
                            description: The name of the recipient.
                            type:
                              - string
                              - "null"
                          email:
                            description: The email of the recipient.
                            type:
                              - string
                              - "null"
                          phone:
                            description: The phone of the recipient.
                            type:
                              - string
                              - "null"
                          externalId:
                            description: The external id of the recipient.
                            type:
                              - string
                              - "null"
                        required:
                          - name
                          - email
                          - phone
                          - externalId
                        additionalProperties: false
                        description: The recipient of the stop.
                      activity:
                        default: delivery
                        type: string
                        enum:
                          - delivery
                          - pickup
                      trackingLink:
                        description: The recipient tracking link.
                        type:
                          - string
                          - "null"
                      timing:
                        type: object
                        properties:
                          timeWindows:
                            maxItems: 2
                            type: array
                            items:
                              type: object
                              properties:
                                earliestAttemptTime:
                                  anyOf:
                                    - type: object
                                      properties:
                                        hour:
                                          type: integer
                                          minimum: 0
                                          maximum: 23
                                          description: Hour of the day
                                        minute:
                                          type: integer
                                          minimum: 0
                                          maximum: 59
                                          description: Minute of the hour
                                      required:
                                        - hour
                                        - minute
                                      additionalProperties: false
                                      description: Time of day in hours and minutes. Uses a 24 hour clock.
                                    - type: "null"
                                  description: Earliest attempt time in this window. Null means there is no earliest time constraint.
                                latestAttemptTime:
                                  anyOf:
                                    - type: object
                                      properties:
                                        hour:
                                          type: integer
                                          minimum: 0
                                          maximum: 23
                                          description: Hour of the day
                                        minute:
                                          type: integer
                                          minimum: 0
                                          maximum: 59
                                          description: Minute of the hour
                                      required:
                                        - hour
                                        - minute
                                      additionalProperties: false
                                      description: Time of day in hours and minutes. Uses a 24 hour clock.
                                    - type: "null"
                                  description: Latest attempt time in this window. Null means there is no latest time constraint.
                              required:
                                - earliestAttemptTime
                                - latestAttemptTime
                              additionalProperties: false
                              description: An arrival window for the stop.
                            description: Ordered arrival windows for this stop.
                          estimatedAttemptDuration:
                            description: Time that the driver estimates to spend on the stop to do his job (deliver a parcel, visit a client, etc) in seconds.
                            type:
                              - number
                              - "null"
                          earliestAttemptTime:
                            anyOf:
                              - type: object
                                properties:
                                  hour:
                                    type: integer
                                    minimum: 0
                                    maximum: 23
                                    description: Hour of the day
                                  minute:
                                    type: integer
                                    minimum: 0
                                    maximum: 59
                                    description: Minute of the hour
                                required:
                                  - hour
                                  - minute
                                additionalProperties: false
                                description: Time of day in hours and minutes. Uses a 24 hour clock.
                              - type: "null"
                            description: The earliest time that the driver should arrive at the stop
                          latestAttemptTime:
                            anyOf:
                              - type: object
                                properties:
                                  hour:
                                    type: integer
                                    minimum: 0
                                    maximum: 23
                                    description: Hour of the day
                                  minute:
                                    type: integer
                                    minimum: 0
                                    maximum: 59
                                    description: Minute of the hour
                                required:
                                  - hour
                                  - minute
                                additionalProperties: false
                                description: Time of day in hours and minutes. Uses a 24 hour clock.
                              - type: "null"
                            description: The latest time that the driver should arrive at the stop.
                        required:
                          - timeWindows
                          - estimatedAttemptDuration
                          - earliestAttemptTime
                          - latestAttemptTime
                        additionalProperties: false
                        description: The timing data of the stop.
                      optimizationOrder:
                        default: default
                        type: string
                        enum:
                          - first
                          - last
                          - default
                      paymentOnDelivery:
                        anyOf:
                          - type: object
                            properties:
                              amount:
                                anyOf:
                                  - type: integer
                                    minimum: 0
                                    maximum: 9007199254740991
                                  - type: "null"
                                description: The amount *in minor units* (e.g. cents) to be collected upon delivery.
                              currency:
                                type: string
                                description: The payment's currency in ISO 4217 standard.
                            required:
                              - amount
                              - currency
                            additionalProperties: false
                            description: The payment due upon delivery also known as "Cash on Delivery".
                          - type: "null"
                      proofOfAttemptRequirements:
                        type: object
                        properties:
                          enabled:
                            description: Whether the proof of attempt is enabled.This only works if the team subscription has access to proof of delivery
                            type:
                              - boolean
                              - "null"
                        required:
                          - enabled
                        additionalProperties: false
                        description: The proof of attempt requirements of the stop.
                      customProperties:
                        anyOf:
                          - type: object
                            propertyNames:
                              type: string
                            additionalProperties:
                              type:
                                - string
                                - "null"
                          - type: "null"
                        description: Custom properties of the stop, can be used to store additional information.
                      clientId:
                        description: The associated Client ID of the Spoke Connect
                        type:
                          - string
                          - "null"
                    required:
                      - id
                      - depot
                      - address
                      - barcodes
                      - allowedDrivers
                      - notes
                      - packageCount
                      - weight
                      - orderInfo
                      - recipient
                      - trackingLink
                      - timing
                      - paymentOnDelivery
                      - proofOfAttemptRequirements
                      - customProperties
                      - clientId
                    additionalProperties: false
                    description: An unassigned stop.
                description: Success
        "400":
          description: The request was invalid
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      message:
                        type: string
                        description: The error message.
                      code:
                        type: string
                        description: The error code.
                      param:
                        type: string
                        description: The parameter that caused the error.
                      url:
                        type: string
                        description: The URL with more information about the error.
                    required:
                      - message
                    description: The request has errors. Either syntactic or semantic
                  - type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                        description: The error code.
                      param:
                        type: string
                        enum:
                          - filter
                      url:
                        type: string
                        description: The URL with more information about the error.
                    required:
                      - message
                      - param
                    description: The provided filter string was invalid.
                    title: Invalid filter string
                  - type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                        description: The error code.
                      param:
                        type: string
                        enum:
                          - sortField
                      url:
                        type: string
                        description: The URL with more information about the error.
                    required:
                      - message
                      - param
                    description: The provided sort field was unknown.
                    title: Unknown sort field
                  - type: object
                    properties:
                      message:
                        type: string
                      code:
                        type: string
                        description: The error code.
                      param:
                        type: string
                        enum:
                          - pageToken
                      url:
                        type: string
                        description: The URL with more information about the error.
                    required:
                      - message
                      - param
                    description: The provided page token was invalid.
                    title: Invalid page token
                description: The request was invalid
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: Unauthorized
        "500":
          description: An internal server error occurred
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: An internal server error occurred
        default:
          description: The default error model
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: The error message.
                  code:
                    type: string
                    description: The error code.
                  param:
                    type: string
                    description: The parameter that caused the error.
                  url:
                    type: string
                    description: The URL with more information about the error.
                required:
                  - message
                description: The default error model
components:
  schemas:
    driverIdSchema:
      type: string
      pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
    planIdSchema:
      type: string
      pattern: ^plans\/[a-zA-Z0-9---_]{1,50}$
    routeIdSchema:
      type: string
      pattern: ^routes\/[a-zA-Z0-9---_]{1,50}$
    routeSchema:
      type: object
      properties:
        id:
          allOf:
            - $ref: "#/components/schemas/routeIdSchema"
          description: The id of the route, in the format `routes/<id>`.
        title:
          type: string
          description: The title of the route.
        stopCount:
          type: number
          description: The number of stops in the route.
        driver:
          anyOf:
            - $ref: "#/components/schemas/driverIdSchema"
            - type: "null"
          description: The id of the driver.
        state:
          anyOf:
            - type: object
              properties:
                completed:
                  type: boolean
                  description: Whether the route is completed.
                completedAt:
                  description: The timestamp the route was completed at.
                  type:
                    - number
                    - "null"
                distributed:
                  type: boolean
                  description: Whether the route is distributed.
                distributedAt:
                  description: The timestamp the route was distributed at.
                  type:
                    - number
                    - "null"
                notifiedRecipients:
                  type: boolean
                  description: Whether the recipients were notified.
                notifiedRecipientsAt:
                  description: The timestamp the recipients were notified at.
                  type:
                    - number
                    - "null"
                started:
                  type: boolean
                  description: Whether the route is started.
                startedAt:
                  description: The timestamp the route was started at.
                  type:
                    - number
                    - "null"
              required:
                - completed
                - completedAt
                - distributed
                - distributedAt
                - notifiedRecipients
                - notifiedRecipientsAt
                - started
                - startedAt
              additionalProperties: false
              description: The state of a route.
            - type: "null"
          description: The state of the route.
        plan:
          anyOf:
            - $ref: "#/components/schemas/planIdSchema"
            - type: "null"
          description: The id of the related plan.
      required:
        - id
        - title
        - stopCount
        - driver
        - state
        - plan
      additionalProperties: false
      description: A route.
    stopIdSchema:
      type: string
      pattern: ^plans\/[a-zA-Z0-9---_]{1,50}\/stops\/[a-zA-Z0-9---_]{1,50}$
    stopSchema:
      type: object
      properties:
        id:
          allOf:
            - $ref: "#/components/schemas/stopIdSchema"
          description: The id of the stop, in the format `plans/<id>/stops/<id>`.
        address:
          type: object
          properties:
            address:
              type: string
              description: The address of the stop.
            addressLineOne:
              type: string
              description: The first line of the address.
            addressLineTwo:
              type: string
              description: The second line of the address.
            latitude:
              anyOf:
                - type: number
                  minimum: -90
                  maximum: 90
                - type: "null"
              description: The latitude of the address in decimal degrees.
            longitude:
              anyOf:
                - type: number
                  minimum: -180
                  maximum: 180
                - type: "null"
              description: The longitude of the address in decimal degrees.
            placeId:
              description: The identifier of the place corresponding to this stop on Google Places
              type:
                - "null"
                - string
            placeTypes:
              type: array
              items:
                type: string
              description: Array of strings that is provided by the Google AutoCompleteAPI
          required:
            - address
            - addressLineOne
            - addressLineTwo
            - latitude
            - longitude
            - placeId
            - placeTypes
          additionalProperties: false
          description: The address of the stop.
        barcodes:
          type: array
          items:
            type: string
          description: List of Barcode IDs associated with the stop.
        allowedDrivers:
          type: array
          items:
            type: string
            pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
          description: The driver IDs that can be assigned to this stop
        estimatedTravelDuration:
          description: Estimated time that the driver will take to arrive at this stop from the previous stop in seconds.
          type:
            - "null"
            - number
        estimatedTravelDistance:
          description: The distance in meters between the previous stop and this stop.
          type:
            - "null"
            - number
        notes:
          description: Notes for the stop.
          type:
            - "null"
            - string
        packageCount:
          description: The number of packages.
          type:
            - "null"
            - number
        weight:
          anyOf:
            - type: object
              properties:
                amount:
                  type: number
                  minimum: 0
                  description: The weight amount for this stop.
                unit:
                  type: string
                  enum:
                    - kilogram
                    - pound
                    - metric-ton
                  description: The weight unit in which the amount is specified (defined at team's capacity unit).
              required:
                - amount
                - unit
              additionalProperties: false
              description: Weight information for the stop.
            - type: "null"
        type:
          type: string
          enum:
            - start
            - stop
            - end
          description: The type of the stop. `start` is the first stop of the route, `stop` is a stop in the middle of the route, and `end` is the last stop of the route.
        packageLabel:
          description: The label of the package.
          type:
            - "null"
            - string
        stopPosition:
          description: The position of the stop in the route.
          type:
            - "null"
            - number
        trackingLink:
          description: The recipient tracking link.
          type:
            - "null"
            - string
        webAppLink:
          type: string
          description: The web app link.
        orderInfo:
          type: object
          properties:
            products:
              type: array
              items:
                type: string
              description: The products of the stop.
            invoiceNumber:
              description: Invoice number associated with the order.
              type:
                - "null"
                - string
            sellerName:
              description: Name of the seller where the order is from.
              type:
                - "null"
                - string
            sellerOrderId:
              description: Id of the seller where the order is from.
              type:
                - "null"
                - string
            sellerWebsite:
              description: Website of the seller where the order is from.
              type:
                - "null"
                - string
          required:
            - products
            - invoiceNumber
            - sellerName
            - sellerOrderId
            - sellerWebsite
          additionalProperties: false
          description: The order information of the stop.
        placeInVehicle:
          anyOf:
            - type: object
              properties:
                x:
                  anyOf:
                    - type: string
                      enum:
                        - left
                        - right
                    - type: "null"
                  description: The x position of the package.
                y:
                  anyOf:
                    - type: string
                      enum:
                        - front
                        - back
                        - middle
                    - type: "null"
                  description: The y position of the package.
                z:
                  anyOf:
                    - type: string
                      enum:
                        - floor
                        - shelf
                    - type: "null"
                  description: The z position of the package.
              required:
                - x
                - y
                - z
              additionalProperties: false
              description: The position of the package in the vehicle.
            - type: "null"
        recipient:
          type: object
          properties:
            name:
              description: The name of the recipient.
              type:
                - "null"
                - string
            email:
              description: The email of the recipient.
              type:
                - "null"
                - string
            phone:
              description: The phone of the recipient.
              type:
                - "null"
                - string
            externalId:
              description: The external id of the recipient.
              type:
                - "null"
                - string
          required:
            - name
            - email
            - phone
            - externalId
          additionalProperties: false
          description: The recipient of the stop.
        activity:
          default: delivery
          type: string
          enum:
            - delivery
            - pickup
        deliveryInfo:
          anyOf:
            - type: object
              properties:
                attempted:
                  type: boolean
                  description: Whether the stop was attempted.
                attemptedAt:
                  description: When the stop was attempted in seconds since epoch.
                  type:
                    - number
                    - "null"
                timeAtStopInfo:
                  oneOf:
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - available
                        value:
                          type: object
                          properties:
                            arrivedAt:
                              description: When the driver arrived at the stop in seconds since epoch.
                              type:
                                - number
                                - "null"
                            departedAt:
                              description: When the driver departed from the stop in seconds since epoch.
                              type:
                                - number
                                - "null"
                            isEstimated:
                              description: Whether the time at stop was estimated rather than directly measured.
                              type:
                                - boolean
                                - "null"
                          required:
                            - arrivedAt
                            - departedAt
                            - isEstimated
                          additionalProperties: false
                          description: Grouped time-at-stop data.
                      required:
                        - status
                        - value
                      additionalProperties: false
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - restricted
                        requiredFeature:
                          type: string
                        upgradeUrl:
                          type: string
                        restrictionCode:
                          type: string
                          enum:
                            - subscription_not_supported
                      required:
                        - status
                      additionalProperties: false
                    - type: object
                      properties:
                        status:
                          type: string
                          enum:
                            - pending
                        pendingReason:
                          type: string
                          enum:
                            - not_yet_arrived
                      required:
                        - status
                      additionalProperties: false
                attemptedLocation:
                  anyOf:
                    - type: object
                      properties:
                        latitude:
                          type: number
                          description: The latitude of the location.
                        longitude:
                          type: number
                          description: The longitude of the location.
                      required:
                        - latitude
                        - longitude
                      additionalProperties: false
                      description: A location.
                    - type: "null"
                  description: Where the stop was attempted.
                driverProvidedInternalNotes:
                  description: Internal notes provided by the driver.
                  type:
                    - string
                    - "null"
                driverProvidedRecipientNotes:
                  description: Recipient notes provided by the driver.
                  type:
                    - string
                    - "null"
                photoUrls:
                  type: array
                  items:
                    type: string
                  description: URLs of proof of delivery photos.
                recipientProvidedNotes:
                  description: Notes from recipient
                  type:
                    - string
                    - "null"
                signatureUrl:
                  description: URL of the signature.
                  type:
                    - string
                    - "null"
                signeeName:
                  description: Name of the signee.
                  type:
                    - string
                    - "null"
                succeeded:
                  type: boolean
                  description: Whether the stop was succeeded.
                state:
                  type: string
                  enum:
                    - delivered_to_recipient
                    - delivered_to_third_party
                    - delivered_to_mailbox
                    - delivered_to_safe_place
                    - delivered_to_pickup_point
                    - delivered_other
                    - picked_up_from_customer
                    - picked_up_unmanned
                    - picked_up_from_locker
                    - picked_up_other
                    - failed_not_home
                    - failed_cant_find_address
                    - failed_no_parking
                    - failed_no_time
                    - failed_package_not_available
                    - failed_other
                    - failed_missing_required_proof
                    - failed_payment_not_received
                    - unattempted
                  description: The state of the delivery.
              required:
                - attempted
                - attemptedAt
                - timeAtStopInfo
                - attemptedLocation
                - driverProvidedInternalNotes
                - driverProvidedRecipientNotes
                - photoUrls
                - recipientProvidedNotes
                - signatureUrl
                - signeeName
                - succeeded
                - state
              additionalProperties: false
              description: The delivery information of the stop.
            - type: "null"
        paymentOnDelivery:
          anyOf:
            - type: object
              properties:
                amount:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: "null"
                  description: The amount *in minor units* (e.g. cents) to be collected upon delivery.
                currency:
                  type: string
                  description: The payment's currency in ISO 4217 standard.
              required:
                - amount
                - currency
              additionalProperties: false
              description: The payment due upon delivery also known as "Cash on Delivery".
            - type: "null"
        proofOfAttemptRequirements:
          type: object
          properties:
            enabled:
              description: Whether the proof of attempt is enabled.This only works if the team subscription has access to proof of delivery
              type:
                - "null"
                - boolean
          required:
            - enabled
          additionalProperties: false
          description: The proof of attempt requirements of the stop.
        plan:
          allOf:
            - $ref: "#/components/schemas/planIdSchema"
          description: The id of the plan, in the format `plans/<id>`.
        route:
          anyOf:
            - $ref: "#/components/schemas/routeSchema"
            - type: "null"
          description: The route of the stop, if any.
        eta:
          oneOf:
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - available
                value:
                  type: object
                  properties:
                    estimatedArrivalAt:
                      type: number
                      description: The estimated time in seconds since epoch.
                    estimatedLatestArrivalAt:
                      type: number
                      description: The latest estimated time in seconds since epoch.
                    estimatedEarliestArrivalAt:
                      type: number
                      description: The earliest estimated time in seconds since epoch.
                  required:
                    - estimatedArrivalAt
                    - estimatedLatestArrivalAt
                    - estimatedEarliestArrivalAt
                  additionalProperties: false
                  description: The estimated time of arrival data of the stop.
              required:
                - status
                - value
              additionalProperties: false
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - restricted
                requiredFeature:
                  type: string
                upgradeUrl:
                  type: string
                restrictionCode:
                  type: string
                  enum:
                    - subscription_not_supported
              required:
                - status
              additionalProperties: false
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - pending
                pendingReason:
                  type: string
                  enum:
                    - not_optimized
              required:
                - status
              additionalProperties: false
        timing:
          type: object
          properties:
            timeWindows:
              maxItems: 2
              type: array
              items:
                type: object
                properties:
                  earliestAttemptTime:
                    anyOf:
                      - $ref: "#/components/schemas/timeOfDaySchema"
                      - type: "null"
                    description: Earliest attempt time in this window. Null means there is no earliest time constraint.
                  latestAttemptTime:
                    anyOf:
                      - $ref: "#/components/schemas/timeOfDaySchema"
                      - type: "null"
                    description: Latest attempt time in this window. Null means there is no latest time constraint.
                required:
                  - earliestAttemptTime
                  - latestAttemptTime
                additionalProperties: false
                description: An arrival window for the stop.
              description: Ordered arrival windows for this stop.
            estimatedAttemptDuration:
              description: Time that the driver estimates to spend on the stop to do his job (deliver a parcel, visit a client, etc) in seconds.
              type:
                - "null"
                - number
            earliestAttemptTime:
              anyOf:
                - $ref: "#/components/schemas/timeOfDaySchema"
                - type: "null"
              description: The earliest time that the driver should arrive at the stop
            latestAttemptTime:
              anyOf:
                - $ref: "#/components/schemas/timeOfDaySchema"
                - type: "null"
              description: The latest time that the driver should arrive at the stop.
          required:
            - timeWindows
            - estimatedAttemptDuration
            - earliestAttemptTime
            - latestAttemptTime
          additionalProperties: false
          description: The timing data of the stop.
        optimizationOrder:
          default: default
          type: string
          enum:
            - first
            - last
            - default
        customProperties:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties:
                type:
                  - string
                  - "null"
            - type: "null"
          description: Custom properties of the stop, can be used to store additional information.
        clientId:
          description: The associated Client ID of the Spoke Connect
          type:
            - "null"
            - string
        serviceInfo:
          oneOf:
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - available
                value:
                  anyOf:
                    - type: object
                      properties:
                        identifier:
                          type: string
                          description: The service offering identifier, as configured in Spoke Dispatch, captured at assignment time. Not currently discoverable through the public API.
                        name:
                          type: string
                          description: The human-readable service name.
                        slaStartsAt:
                          type: number
                          description: The SLA start time in seconds since epoch.
                        slaDueDate:
                          type: object
                          properties:
                            day:
                              type: integer
                              minimum: 1
                              maximum: 31
                              description: The day of the date.
                            month:
                              type: integer
                              minimum: 1
                              maximum: 12
                              description: The month of the date.
                            year:
                              type: integer
                              minimum: 2000
                              maximum: 2100
                              description: The year of the date.
                          required:
                            - day
                            - month
                            - year
                          additionalProperties: false
                          description: The computed SLA due date in the team's timezone.
                        slaDueTime:
                          anyOf:
                            - $ref: "#/components/schemas/timeOfDaySchema"
                            - type: "null"
                          description: SLA due time-of-day in the team's timezone, null for day-level SLA.
                        deliveryHorizon:
                          type: object
                          properties:
                            unit:
                              anyOf:
                                - type: string
                                  enum:
                                    - days
                                    - hours
                                - type: string
                              description: "The time unit of the delivery horizon. Known: `days`, `hours`."
                            value:
                              type: number
                              description: The number of time units in the delivery horizon.
                          required:
                            - unit
                            - value
                          additionalProperties: false
                          description: The delivery horizon for this service.
                        price:
                          type: object
                          properties:
                            value:
                              type: number
                              description: Price in minor currency units (e.g. cents).
                            currency:
                              anyOf:
                                - type: string
                                  enum:
                                    - AED
                                    - ARS
                                    - AUD
                                    - BRL
                                    - CAD
                                    - CHF
                                    - CLP
                                    - CNY
                                    - COP
                                    - DKK
                                    - EGP
                                    - EUR
                                    - GBP
                                    - HKD
                                    - HUF
                                    - ILS
                                    - INR
                                    - JPY
                                    - KRW
                                    - MYR
                                    - MXN
                                    - NOK
                                    - NZD
                                    - PEN
                                    - RON
                                    - RUB
                                    - SAR
                                    - SEK
                                    - SGD
                                    - TRY
                                    - USD
                                    - UYU
                                    - ZAR
                                - type: string
                              description: 3-letter ISO 4217 currency code.
                          required:
                            - value
                            - currency
                          additionalProperties: false
                          description: Price for this service at assignment time.
                        hasPaymentOnDelivery:
                          type: boolean
                          description: Whether cash on delivery is enabled via the service.
                        definedAt:
                          type: number
                          description: When the service was assigned in seconds since epoch.
                      required:
                        - identifier
                        - name
                        - slaStartsAt
                        - slaDueDate
                        - slaDueTime
                        - deliveryHorizon
                        - price
                        - hasPaymentOnDelivery
                        - definedAt
                      additionalProperties: false
                      description: Service offering data when a service is assigned to the stop.
                    - type: object
                      properties:
                        identifier:
                          type: "null"
                          description: Null indicates no service offering is linked.
                        slaStartsAt:
                          type: number
                          description: The SLA start time in seconds since epoch.
                      required:
                        - identifier
                        - slaStartsAt
                      additionalProperties: false
                      description: Service data when only an SLA start time is set.
                  description: Service offering data for this stop.
              required:
                - status
                - value
              additionalProperties: false
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - empty
              required:
                - status
              additionalProperties: false
            - type: object
              properties:
                status:
                  type: string
                  enum:
                    - restricted
                requiredFeature:
                  type: string
                upgradeUrl:
                  type: string
                restrictionCode:
                  type: string
                  enum:
                    - subscription_not_supported
              required:
                - status
              additionalProperties: false
          description: Service offering data for this stop.
      required:
        - id
        - address
        - barcodes
        - allowedDrivers
        - estimatedTravelDuration
        - estimatedTravelDistance
        - notes
        - packageCount
        - weight
        - type
        - packageLabel
        - stopPosition
        - trackingLink
        - webAppLink
        - orderInfo
        - placeInVehicle
        - recipient
        - deliveryInfo
        - paymentOnDelivery
        - proofOfAttemptRequirements
        - plan
        - route
        - eta
        - timing
        - customProperties
        - clientId
        - serviceInfo
      additionalProperties: false
      description: A stop of a plan, can be related to a route.
    timeOfDaySchema:
      type: object
      properties:
        hour:
          type: integer
          minimum: 0
          maximum: 23
          description: Hour of the day
        minute:
          type: integer
          minimum: 0
          maximum: 59
          description: Minute of the hour
      required:
        - hour
        - minute
      additionalProperties: false
      description: Time of day in hours and minutes. Uses a 24 hour clock.
    unassignedStopIdSchema:
      type: string
      pattern: ^unassignedStops\/[a-zA-Z0-9---_]{1,50}$
    unassignedStopSchema:
      type: object
      properties:
        id:
          allOf:
            - $ref: "#/components/schemas/unassignedStopIdSchema"
          description: The id of the unassigned stop, in the format `unassignedStops/<id>`.
        depot:
          type: string
          pattern: ^depots\/[a-zA-Z0-9---_]{1,50}$
          description: The depot that this unassigned stop belongs to.
        address:
          type: object
          properties:
            address:
              type: string
              description: The address of the stop.
            addressLineOne:
              type: string
              description: The first line of the address.
            addressLineTwo:
              type: string
              description: The second line of the address.
            latitude:
              anyOf:
                - type: number
                  minimum: -90
                  maximum: 90
                - type: "null"
              description: The latitude of the address in decimal degrees.
            longitude:
              anyOf:
                - type: number
                  minimum: -180
                  maximum: 180
                - type: "null"
              description: The longitude of the address in decimal degrees.
            placeId:
              description: The identifier of the place corresponding to this stop on Google Places
              type:
                - "null"
                - string
            placeTypes:
              type: array
              items:
                type: string
              description: Array of strings that is provided by the Google AutoCompleteAPI
          required:
            - address
            - addressLineOne
            - addressLineTwo
            - latitude
            - longitude
            - placeId
            - placeTypes
          additionalProperties: false
          description: The address of the stop.
        barcodes:
          type: array
          items:
            type: string
          description: List of Barcode IDs associated with the stop.
        allowedDrivers:
          type: array
          items:
            type: string
            pattern: ^drivers\/[a-zA-Z0-9---_]{1,50}$
          description: The driver IDs that can be assigned to this stop.
        notes:
          description: Notes for the stop.
          type:
            - "null"
            - string
        packageCount:
          description: The number of packages.
          type:
            - "null"
            - number
        weight:
          anyOf:
            - type: object
              properties:
                amount:
                  type: number
                  minimum: 0
                  description: The weight amount for this stop.
                unit:
                  type: string
                  enum:
                    - kilogram
                    - pound
                    - metric-ton
                  description: The weight unit in which the amount is specified (defined at team's capacity unit).
              required:
                - amount
                - unit
              additionalProperties: false
              description: Weight information for the stop.
            - type: "null"
        orderInfo:
          type: object
          properties:
            products:
              type: array
              items:
                type: string
              description: The products of the stop.
            invoiceNumber:
              description: Invoice number associated with the order.
              type:
                - "null"
                - string
            sellerName:
              description: Name of the seller where the order is from.
              type:
                - "null"
                - string
            sellerOrderId:
              description: Id of the seller where the order is from.
              type:
                - "null"
                - string
            sellerWebsite:
              description: Website of the seller where the order is from.
              type:
                - "null"
                - string
          required:
            - products
            - invoiceNumber
            - sellerName
            - sellerOrderId
            - sellerWebsite
          additionalProperties: false
          description: The order information of the stop.
        recipient:
          type: object
          properties:
            name:
              description: The name of the recipient.
              type:
                - "null"
                - string
            email:
              description: The email of the recipient.
              type:
                - "null"
                - string
            phone:
              description: The phone of the recipient.
              type:
                - "null"
                - string
            externalId:
              description: The external id of the recipient.
              type:
                - "null"
                - string
          required:
            - name
            - email
            - phone
            - externalId
          additionalProperties: false
          description: The recipient of the stop.
        activity:
          default: delivery
          type: string
          enum:
            - delivery
            - pickup
        trackingLink:
          description: The recipient tracking link.
          type:
            - "null"
            - string
        timing:
          type: object
          properties:
            timeWindows:
              maxItems: 2
              type: array
              items:
                type: object
                properties:
                  earliestAttemptTime:
                    anyOf:
                      - $ref: "#/components/schemas/timeOfDaySchema"
                      - type: "null"
                    description: Earliest attempt time in this window. Null means there is no earliest time constraint.
                  latestAttemptTime:
                    anyOf:
                      - $ref: "#/components/schemas/timeOfDaySchema"
                      - type: "null"
                    description: Latest attempt time in this window. Null means there is no latest time constraint.
                required:
                  - earliestAttemptTime
                  - latestAttemptTime
                additionalProperties: false
                description: An arrival window for the stop.
              description: Ordered arrival windows for this stop.
            estimatedAttemptDuration:
              description: Time that the driver estimates to spend on the stop to do his job (deliver a parcel, visit a client, etc) in seconds.
              type:
                - "null"
                - number
            earliestAttemptTime:
              anyOf:
                - $ref: "#/components/schemas/timeOfDaySchema"
                - type: "null"
              description: The earliest time that the driver should arrive at the stop
            latestAttemptTime:
              anyOf:
                - $ref: "#/components/schemas/timeOfDaySchema"
                - type: "null"
              description: The latest time that the driver should arrive at the stop.
          required:
            - timeWindows
            - estimatedAttemptDuration
            - earliestAttemptTime
            - latestAttemptTime
          additionalProperties: false
          description: The timing data of the stop.
        optimizationOrder:
          default: default
          type: string
          enum:
            - first
            - last
            - default
        paymentOnDelivery:
          anyOf:
            - type: object
              properties:
                amount:
                  anyOf:
                    - type: integer
                      minimum: 0
                      maximum: 9007199254740991
                    - type: "null"
                  description: The amount *in minor units* (e.g. cents) to be collected upon delivery.
                currency:
                  type: string
                  description: The payment's currency in ISO 4217 standard.
              required:
                - amount
                - currency
              additionalProperties: false
              description: The payment due upon delivery also known as "Cash on Delivery".
            - type: "null"
        proofOfAttemptRequirements:
          type: object
          properties:
            enabled:
              description: Whether the proof of attempt is enabled.This only works if the team subscription has access to proof of delivery
              type:
                - "null"
                - boolean
          required:
            - enabled
          additionalProperties: false
          description: The proof of attempt requirements of the stop.
        customProperties:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties:
                type:
                  - string
                  - "null"
            - type: "null"
          description: Custom properties of the stop, can be used to store additional information.
        clientId:
          description: The associated Client ID of the Spoke Connect
          type:
            - "null"
            - string
      required:
        - id
        - depot
        - address
        - barcodes
        - allowedDrivers
        - notes
        - packageCount
        - weight
        - orderInfo
        - recipient
        - trackingLink
        - timing
        - paymentOnDelivery
        - proofOfAttemptRequirements
        - customProperties
        - clientId
      additionalProperties: false
      description: An unassigned stop.
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: Use the API key as the username and leave the password empty.
````