tread.io SiteRateSchedules API

The SiteRateSchedules API from tread.io — 2 operation(s) for siterateschedules.

OpenAPI Specification

treadio-siterateschedules-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Horizon API V1 AccountExternalTruckIdentifier SiteRateSchedules API
  version: '1.0'
  contact:
    name: Tread
    url: https://tread.io
    email: developers@tread.io
  description: 'This is the Version 1 implementation.


    When in doubt we default to the practices outlined [here](https://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#advanced-queries)'
  license:
    name: Private
    url: https://tread.io
servers:
- description: production
  url: https://api.tread-horizon.com
security:
- bearerAuth: []
tags:
- name: SiteRateSchedules
paths:
  /v1/projects/{project-id}/site_rate_schedules:
    parameters:
    - schema:
        type: string
        format: uuid
      name: project-id
      in: path
      required: true
      description: Project ID
    - $ref: '#/components/parameters/Accept-Language'
    post:
      summary: Create a SiteRateSchedule for a Project
      tags:
      - SiteRateSchedules
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/SiteRateSchedule-Read'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: post-v1-projects-project-id-site_rate_schedules
      x-stoplight:
        id: 9t7id39o20c58
      x-internal: true
      description: Create a `SiteRateSchedule` for a `Project`
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteRateSchedule-Create'
    get:
      summary: Retrieve SiteRateSchedules for a Project
      tags:
      - SiteRateSchedules
      responses:
        '200':
          description: OK
          headers:
            Link:
              schema:
                type: string
              description: ' Contains prev and next links for pagination'
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    type: array
                    x-stoplight:
                      id: uviq1t32dfz3d
                    items:
                      $ref: '#/components/schemas/SiteRateSchedule-Read'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
      operationId: get-v1-projects-project-id-site_rate_schedules
      x-stoplight:
        id: u9lgfbaq3wu8d
      description: Retrieve `SiteRateSchedules` for a `Project`
      x-internal: true
      parameters:
      - $ref: '#/components/parameters/page-limit'
      - $ref: '#/components/parameters/page-after'
      - $ref: '#/components/parameters/page-before'
      - $ref: '#/components/parameters/filter-site_id'
  /v1/site_rate_schedules/{id}:
    parameters:
    - schema:
        type: string
        format: uuid
      name: id
      in: path
      required: true
      description: SiteRateSchedule ID
    - $ref: '#/components/parameters/Accept-Language'
    patch:
      summary: Update SiteRateSchedule
      tags:
      - SiteRateSchedules
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - data
                properties:
                  data:
                    $ref: '#/components/schemas/SiteRateSchedule-Read'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
        '415':
          $ref: '#/components/responses/Error'
        '422':
          $ref: '#/components/responses/ModelError'
      operationId: patch-v1-site_rate_schedules-id
      x-stoplight:
        id: 7n97um2fzgwax
      x-internal: true
      description: Update `SiteRateSchedule` by ID
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteRateSchedule-Update'
    delete:
      summary: Delete SiteRateSchedule
      tags:
      - SiteRateSchedules
      responses:
        '204':
          description: No Content
        '401':
          $ref: '#/components/responses/UnauthenticatedError'
        '404':
          $ref: '#/components/responses/Error'
        '406':
          $ref: '#/components/responses/Error'
      operationId: delete-v1-site_rate_schedules-id
      x-stoplight:
        id: n0vscbzjpxo1j
      x-internal: true
      description: Delete `SiteRateSchedule` by ID
      requestBody:
        content: {}
components:
  responses:
    ModelError:
      description: ''
      content:
        application/json:
          schema:
            type: object
            $ref: '#/components/schemas/ModelError-Response'
    Error:
      description: Error response
      content:
        application/json:
          schema:
            type: object
            $ref: '#/components/schemas/Error-Response'
    UnauthenticatedError:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            $ref: '#/components/schemas/UnauthenticatedError-Response'
  parameters:
    filter-site_id:
      name: filter[site_id]
      in: query
      required: false
      schema:
        type: string
        format: uuid
      description: The associated Site ID
    Accept-Language:
      name: Accept-Language
      in: header
      schema:
        type: string
        default: en
        example: en
      description: 'The Accept-Language request HTTP header indicates the natural language and locale that the client prefers. '
    page-limit:
      name: page[limit]
      in: query
      schema:
        type: integer
        format: int32
        default: 25
        maximum: 100
      description: The maximum number of paginated results to return
    page-before:
      name: page[before]
      in: query
      required: false
      schema:
        type: string
      description: The cursor to stop paginating at
    page-after:
      name: page[after]
      in: query
      required: false
      schema:
        type: string
      description: The cursor to start paginating after
  schemas:
    Error-Response:
      title: Error-Response
      x-stoplight:
        id: 52cydhphee3qe
      type: object
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/Error'
      additionalProperties: false
    GeofenceType:
      title: GeofenceType
      x-stoplight:
        id: geahowr9r8ly1
      nullable: true
      enum:
      - moving
      - circle
      - polygon
      readOnly: true
    NextBillionGeofence-Read:
      title: NextBillionGeofence-Read
      x-stoplight:
        id: 60y0z4bb3pu6m
      allOf:
      - $ref: '#/components/schemas/Identifier'
      - $ref: '#/components/schemas/Geofence-Data'
    SiteRateSchedule-Update:
      title: SiteRateSchedule-Update
      x-stoplight:
        id: os3zgqwwdr5j4
      type: object
      properties:
        site_id:
          type: string
          x-stoplight:
            id: s749p4za9ezo3
          format: uuid
          nullable: true
        customer_rate_id:
          type: string
          x-stoplight:
            id: d0lz0b6qrhxjv
          format: uuid
          nullable: true
        customer_rate_value:
          type: number
          x-stoplight:
            id: zswnlulxi66y2
          nullable: true
        customer_rate_type:
          $ref: '#/components/schemas/NullableRateType'
        vendor_rate_id:
          type: string
          x-stoplight:
            id: 85lsswuhrjjvy
          format: uuid
          nullable: true
        vendor_rate_value:
          type: number
          x-stoplight:
            id: j9u5hj26065pp
          nullable: true
        vendor_rate_type:
          $ref: '#/components/schemas/NullableRateType'
        driver_rate_id:
          type: string
          x-stoplight:
            id: 9jwsydwvyup3a
          format: uuid
          nullable: true
        driver_rate_value:
          type: number
          x-stoplight:
            id: cc33k6uec52oc
          nullable: true
        driver_rate_type:
          $ref: '#/components/schemas/NullableRateType'
      additionalProperties: false
    Discardable:
      title: Discardable
      x-stoplight:
        id: 46axlb8u5wjay
      type: object
      required:
      - discarded_at
      properties:
        discarded_at:
          type: string
          x-stoplight:
            id: cy8t6fecoyxbo
          format: date-time
          nullable: true
      additionalProperties: false
    GeofenceTag:
      title: GeofenceTag
      x-stoplight:
        id: anytkmb3ydi6c
      enum:
      - scaling
      - site
      - loading
      - unloading
      - check_in
      - ticketing
    Address-Read-Nested:
      title: Address-Read-Nested
      x-stoplight:
        id: cvym2dzuo375q
      allOf:
      - $ref: '#/components/schemas/Identifier'
      - $ref: '#/components/schemas/Address-Read'
    Error:
      title: Error
      x-stoplight:
        id: 3g57kkik3l464
      type: object
      description: An Error.
      required:
      - code
      properties:
        code:
          type: string
          x-stoplight:
            id: 7o9x1t8v0bgfo
      additionalProperties: false
    ModelError-Item:
      title: ModelError-Item
      x-stoplight:
        id: b93chwval2t8d
      type: object
      required:
      - model
      - field
      - message
      properties:
        model:
          type: string
          x-stoplight:
            id: 30myfyjkno8ao
          description: The Model associated with this Error
        field:
          type: string
          x-stoplight:
            id: 8gl4ed3uxhdws
          description: The field associated with this Error
        message:
          type: string
          x-stoplight:
            id: bmgbrtmw17qsj
          description: The Error message
      additionalProperties: false
    UnauthenticatedError:
      title: UnauthenticatedError
      x-stoplight:
        id: 202o69l0fs40h
      allOf:
      - $ref: '#/components/schemas/Error'
      - type: object
        x-stoplight:
          id: tg10dt7s0l6bw
        properties:
          error_type:
            type: string
            x-stoplight:
              id: wvq8c0qsym4hz
        required:
        - error_type
    ModelError:
      title: ModelError
      x-stoplight:
        id: nhp6714o4j1qt
      description: A Model-specific error
      allOf:
      - $ref: '#/components/schemas/Error'
      - type: object
        required:
        - errors
        properties:
          errors:
            type: array
            x-stoplight:
              id: m4ul9vcq2deh6
            items:
              $ref: '#/components/schemas/ModelError-Item'
    Timestamps:
      title: Timestamps
      x-stoplight:
        id: t82ecgfu0oj00
      type: object
      required:
      - created_at
      - updated_at
      properties:
        created_at:
          type: string
          x-stoplight:
            id: gjj950jpq0ga9
          format: date-time
          description: ISO8601 timestamp with local timezone
        updated_at:
          type: string
          x-stoplight:
            id: bwcuyfwc7aj0e
          format: date-time
          description: ISO8601 timestamp with local timezone
      additionalProperties: false
    Identifier:
      title: Identifier
      x-stoplight:
        id: gnd39lue5v7ol
      type: object
      required:
      - id
      properties:
        id:
          type: string
          x-stoplight:
            id: 2e38hjk4zd58m
          format: uuid
      additionalProperties: false
    NullableGeofenceType:
      title: NullableGeofenceType
      x-stoplight:
        id: ii94t82oqh5xo
      allOf:
      - $ref: '#/components/schemas/GeofenceType'
      nullable: true
      type: string
    RateType:
      title: RateType
      x-stoplight:
        id: zn2jb7gsifkk3
      enum:
      - RatePerHour
      - RatePerDay
      - RatePerLoad
      - RatePerTon
      - RatePerTonne
      - RatePerYard
      - RatePerBushel
      - RateCommission
      - RateFlatCommission
      - RateFlatRate
      example: RatePerHour
    SiteRateSchedule-Create:
      title: SiteRateSchedule-Create
      x-stoplight:
        id: v2i3mk9aik5jb
      type: object
      properties:
        site_id:
          type: string
          x-stoplight:
            id: ts12o1kz34gw2
          format: uuid
          nullable: true
        customer_rate_id:
          type: string
          x-stoplight:
            id: lr57ec8w1gr3g
          format: uuid
          nullable: true
        customer_rate_value:
          type: number
          x-stoplight:
            id: 2v9p3t8q3m68f
          nullable: true
        customer_rate_type:
          $ref: '#/components/schemas/NullableRateType'
        vendor_rate_id:
          type: string
          x-stoplight:
            id: qqnr5hfhpm164
          format: uuid
          nullable: true
        vendor_rate_value:
          type: number
          x-stoplight:
            id: 9ejrujhe42281
          nullable: true
        vendor_rate_type:
          $ref: '#/components/schemas/NullableRateType'
        driver_rate_id:
          type: string
          x-stoplight:
            id: sate8n6spba02
          format: uuid
          nullable: true
        driver_rate_value:
          type: number
          x-stoplight:
            id: c7s8ctper3cq0
          nullable: true
        driver_rate_type:
          $ref: '#/components/schemas/NullableRateType'
      additionalProperties: false
    NullableRateType:
      title: NullableRateType
      x-stoplight:
        id: rajiobym5ovlp
      allOf:
      - $ref: '#/components/schemas/RateType'
      nullable: true
      type: string
    Rate-Read-Nested:
      title: Rate-Read-Nested
      x-stoplight:
        id: 1e88o8oi36nft
      allOf:
      - $ref: '#/components/schemas/Identifier'
      - type: object
        required:
        - name
        - type
        properties:
          name:
            type: string
            x-stoplight:
              id: zj6ioiudweh1e
          type:
            $ref: '#/components/schemas/RateType'
    Site-Read-Nested:
      title: Site-Read-Nested
      x-stoplight:
        id: rt6xqxsfzf4iv
      allOf:
      - $ref: '#/components/schemas/Identifier'
      - type: object
        required:
        - name
        - lat
        - lon
        - full_address
        - routable
        properties:
          name:
            type: string
            x-stoplight:
              id: 7r0x7wicrvwyy
          lat:
            type: string
            x-stoplight:
              id: cr6y5v0hdl5oo
            nullable: true
          lon:
            type: string
            x-stoplight:
              id: f23mkvamncbuw
            nullable: true
          address:
            $ref: '#/components/schemas/Address-Read-Nested'
          full_address:
            type: string
            x-stoplight:
              id: uxixxnmgfi47i
            nullable: true
          routable:
            type: boolean
            x-stoplight:
              id: uobfxkm0hujhv
          next_billion_geofence:
            $ref: '#/components/schemas/NextBillionGeofence-Read'
      - $ref: '#/components/schemas/Discardable'
    Address-Read:
      title: Address-Read
      x-stoplight:
        id: v1mcd2qgns2tf
      type: object
      required:
      - thoroughfare
      - premise
      - locality
      - administrative_area
      - postal_code
      - country
      - lat
      - lon
      - place_id
      properties:
        thoroughfare:
          type: string
          x-stoplight:
            id: 8wrr7qkc9ilqn
        premise:
          type: string
          x-stoplight:
            id: z4jth408out1q
          nullable: true
        locality:
          type: string
          x-stoplight:
            id: kfby6wqpgvxbz
        administrative_area:
          type: string
          x-stoplight:
            id: c9bkrloxf4t8d
        postal_code:
          type: string
          x-stoplight:
            id: 7zq51k1mof3o3
        country:
          type: string
          x-stoplight:
            id: iydw9q619ya01
          pattern: ^[A-Z]{2}
          example: US
          minLength: 2
          maxLength: 2
        lat:
          type: string
          x-stoplight:
            id: kqu1qtf9rivh1
          description: "latitude of the `Address`. \n\nMust be a stringified number between -90 and 90 inclusive.\n\nRequired if `lon` is present."
          nullable: true
        lon:
          type: string
          x-stoplight:
            id: oly2yabkzpk9g
          description: "longitude of the `Address`. \n\nMust be a stringified number between -180 and 180 inclusive.\n\nRequired if `lat` is present."
          nullable: true
        place_id:
          type: string
          x-stoplight:
            id: im1fdq7qqxdij
          description: NextBillion placeID
          nullable: true
      additionalProperties: false
    UnauthenticatedError-Response:
      title: UnauthenticatedError-Response
      x-stoplight:
        id: o477eph7ttbzt
      type: object
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/UnauthenticatedError'
      additionalProperties: false
    Geofence-Data:
      title: Geofence-Data
      x-stoplight:
        id: ay73k76oae8gm
      type: object
      properties:
        id:
          type: string
          format: uuid
          x-stoplight:
            id: m9n8p7q6r5s4t
          description: NextBillionGeofence ID
        geofence:
          type: object
          x-stoplight:
            id: bo67u046r1ibk
          required:
          - name
          - type
          properties:
            id:
              type: string
              x-stoplight:
                id: nm2o97jli2zqm
              format: uuid
              description: NextBillion Geofence ID
            name:
              type: string
              x-stoplight:
                id: x5sp8wq8d2ack
            type:
              type: string
              x-stoplight:
                id: d91rv1gbtfkm0
              description: '`circle` or `polygon`'
            geojson:
              type: object
              x-stoplight:
                id: vk7dx7ipdbuxa
              required:
              - type
              - coordinates
              properties:
                type:
                  type: string
                  x-stoplight:
                    id: 65qatpxdox3e9
                  description: type should be `Polygon`
                coordinates:
                  type: array
                  x-stoplight:
                    id: 3an8g587wblcs
                  description: 'This should be an enclosed polygon.


                    Example format:

                    [[[-118.226140484,34.048200454],[-118.22616052,34.046872766],[-118.226198738,34.04952736],[-118.226140484,34.048200454]]]'
                  items:
                    x-stoplight:
                      id: 2kltvjxl5xks6
                    type: array
                    items:
                      x-stoplight:
                        id: k93dt39dghru4
                      type: array
                      items: {}
            circle_center:
              type: object
              x-stoplight:
                id: 6xr3h683f7cl9
              required:
              - lat
              - lon
              properties:
                lat:
                  type: number
                  x-stoplight:
                    id: y70xc1ptapv1g
                lon:
                  type: number
                  x-stoplight:
                    id: uy3twrpcueq9m
            circle_radius:
              type: number
              x-stoplight:
                id: qrnq301sqfl3d
            tag:
              x-stoplight:
                id: debfy3x1l48zc
              enum:
              - pickup
              - loading
              - drop_off
              - unloading
              - check_in
              - scaling
              - ticketing
              deprecated: true
        moving_geofence:
          type: boolean
          x-stoplight:
            id: y15533dbr62js
          default: false
        tag:
          $ref: '#/components/schemas/GeofenceTag'
        geofence_type:
          $ref: '#/components/schemas/NullableGeofenceType'
      additionalProperties: false
    SiteRateSchedule-Read:
      title: SiteRateSchedule-Read
      x-stoplight:
        id: 44jre1z43iv9r
      allOf:
      - type: object
        required:
        - customer_rate_value
        - customer_rate_type
        - vendor_rate_value
        - vendor_rate_type
        - driver_rate_value
        - driver_rate_type
        - auto_add_on_assignments_count
        properties:
          site:
            $ref: '#/components/schemas/Site-Read-Nested'
          customer_rate:
            $ref: '#/components/schemas/Rate-Read-Nested'
          customer_rate_value:
            type: string
            x-stoplight:
              id: i4y0q2txezcdz
            nullable: true
          customer_rate_type:
            $ref: '#/components/schemas/NullableRateType'
          vendor_rate:
            $ref: '#/components/schemas/Rate-Read-Nested'
          vendor_rate_value:
            type: string
            x-stoplight:
              id: isagxw0yrscaf
            nullable: true
          vendor_rate_type:
            $ref: '#/components/schemas/NullableRateType'
          driver_rate:
            $ref: '#/components/schemas/Rate-Read-Nested'
          driver_rate_value:
            type: string
            x-stoplight:
              id: 2xgp2yjeeglk8
            nullable: true
          driver_rate_type:
            $ref: '#/components/schemas/NullableRateType'
          auto_add_on_assignments_count:
            type: integer
            x-stoplight:
              id: wcgxtgzymeyye
      - $ref: '#/components/schemas/Identifier'
      - $ref: '#/components/schemas/Timestamps'
    ModelError-Response:
      title: ModelError-Response
      x-stoplight:
        id: payf9ndh3l6np
      type: object
      required:
      - error
      properties:
        error:
          $ref: '#/components/schemas/ModelError'
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
x-stoplight:
  id: 75rfxjepk4523