openapi: 3.1.0
info:
  description: M2X APIs
  version: 1.0.0
  title: M2X APIS
  license:
    name: All Rights Reserved
    identifier: All Rights Reserved
tags:
  - name: Analytics
    description: Analytics data
  - name: Billing Groups
    description: Invoiceable unit used by the system
  - name: Bookings
    description: Bookings information
  - name: Carrier Bookings
    description: Corporate bookings received by carriers
  - name: Carrier Large Contracts
    description: Carrier large contracts
  - name: Carrier Orders
    description: Carrier orders
  - name: Corporate Planning
    description: Corporate Planning supplies and demands
  - name: Customer Bookings
    description: Customer bookings on carriers
  - name: Customers
    description: Customers used for invoices
  - name: Drivers
    description: Drivers information
  - name: Fuel
    description: Fuel deliveries management
  - name: Fulfilment Requests
    description: Fulfilment request on carriers
  - name: General Consignments
    description: General consignments
  - name: ISO containers
    description: ISO containers information
  - name: Jobs
    description: Vehicle units of work
  - name: Locations
    description: Locations information
  - name: Master Bookings
    description: Master bookings
  - name: Offers
    description: Corporate monetary offers to carriers
  - name: Products
    description: Products used by the system
  - name: Runs
    description: Runs management
  - name: Subcontractors
    description: Subcontractors information
  - name: Tractor Unit
    description: Tractor units information
  - name: Trailer
    description: Trailers information
  - name: Transaction
    description: Transaction management
  - name: Vehicle
    description: Vehicles information
  - name: Vehicle Execution Statements
    description: Unit of execution for trucks
paths:
  /analytics/sla:
    post:
      tags:
        - Analytics
      summary: Retrieve SLA analytics data
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SLARequest'
        description: Query criteria for SLA data
        required: true
      responses:
        '200':
          description: The requested SLA(DIFOT) analytics data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SLA'
      security:
        - M2X_auth_application:
            - read:bookings
  /vehicles:
    get:
      tags:
        - Vehicle
      summary: Get vehicles list
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Vehicle'
      security:
        - M2X_auth_application:
            - read:vehicles
    post:
      tags:
        - Vehicle
      summary: Create new vehicle
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleRequest'
        description: Update for the vehicle
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vehicle'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:vehicles
  /vehicles/bulk:
    post:
      tags:
        - Vehicle
      summary: Update vehicles bulk
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                  - id
                  - vehicle
                properties:
                  id:
                    type: string
                  vehicle:
                    $ref: '#/components/schemas/VehicleRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:vehicles
  /vehicles/{vehicleId}:
    get:
      tags:
        - Vehicle
      summary: Find vehicle by ID
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vehicle'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:vehicles
    put:
      tags:
        - Vehicle
      summary: Update/create vehicle by ID
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleRequest'
        description: Update for the vehicle
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Vehicle'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:vehicles
  /vehicles/{vehicleId}/location:
    post:
      tags:
        - Vehicle
      summary: Updates vehicle location
      description: ''
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleLocation'
        description: Update for the vehicle location
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VehicleLocation'
        '405':
          description: Invalid input
      security:
        - M2X_auth_application:
            - write:vehicleLocations
  /vehicles/serviceDay/{serviceDay}/shifts:
    get:
      tags:
        - Vehicle
      summary: Get day published shifts (Webhook DTO)
      parameters:
        - name: serviceDay
          in: path
          description: The day of the shifts in ISO day (YYYY-MM-DD)
          required: true
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/PublishedShift'
      security:
        - M2X_auth_application:
            - read:vehicles
  /vehicles/{vehicleId}/tasks:
    get:
      tags:
        - Vehicle
      summary: Get vehicle published tasks
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
        - name: fromTimestamp
          in: query
          description: Start of the queried time window
          required: false
          schema:
            type: integer
            format: int64
        - name: toTimestamp
          in: query
          description: End of the queried time window
          required: false
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Task'
        '404':
          description: Vehicle not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:vehicles
  /vehicles/{vehicleId}/tasks/shiftId/{shiftId}:
    get:
      tags:
        - Vehicle
      summary: Get vehicle published tasks by shift id (Webhook DTO)
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
        - name: shiftId
          in: path
          description: The shift id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  shiftId:
                    type: string
                  tasks:
                    type: array
                    items:
                      $ref: '#/components/schemas/Task'
        '404':
          description: Vehicle not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:vehicles
  /vehicles/{vehicleId}/tasks/serviceDay/{serviceDay}:
    get:
      tags:
        - Vehicle
      summary: Get vehicle published tasks by service day
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
        - name: serviceDay
          in: path
          description: The day of the tasks in ISO day (YYYY-MM-DD)
          required: true
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Task'
        '404':
          description: Vehicle not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:vehicles
  /vehicles/{vehicleId}/tasks/serviceDay/{serviceDay}/shiftIndex/{shiftIndex}:
    get:
      tags:
        - Vehicle
      summary: Get vehicle published tasks by service day and shift
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
        - name: serviceDay
          in: path
          description: The day of the tasks in ISO day (YYYY-MM-DD)
          required: true
          schema:
            type: string
            format: date
        - name: shiftIndex
          in: path
          description: The index of the shift, typically 0 for day and 1 for night
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Task'
        '404':
          description: Vehicle not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:vehicles
  /vehicles/{vehicleId}/tasks/{taskId}:
    put:
      tags:
        - Vehicle
      summary: Update task actuals
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
        - name: taskId
          in: path
          description: The task Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaskUpdate'
        description: Task update
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Task'
        '404':
          description: Vehicle or task not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:tasks
  /vehicles/{vehicleId}/tasks/{taskId}/upload/attachment/{attachmentId}:
    put:
      tags:
        - Vehicle
      summary: Task upload attachment
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
        - name: taskId
          in: path
          description: The task Id
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: The Attachment Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                attachment:
                  type: string
                  format: binary
                  description: >-
                    Supported content types: application/pdf, image/jpeg,
                    image/png
        description: Attachment
        required: true
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '404':
          description: Vehicle or task not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:tasks
  /vehicles/{vehicleId}/tasks/{taskId}/attachment/{attachmentId}:
    get:
      tags:
        - Vehicle
      summary: get task attachment
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle Id
          required: true
          schema:
            type: string
        - name: taskId
          in: path
          description: The task Id
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: The Attachment Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: Vehicle, task or attachment not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:tasks
  /vehicles/{vehicleId}/activeTask:
    post:
      tags:
        - Vehicle
      summary: Set the next active task for a vehicle
      parameters:
        - name: vehicleId
          in: path
          description: The vehicle ID
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleActiveTaskRequest'
        description: Vehicle active task request
        required: true
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          description: Vehicle or task not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:tasks
  /tractorUnits:
    get:
      tags:
        - Tractor Unit
      summary: Get tractor units list
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TractorUnit'
      security:
        - M2X_auth_application:
            - read:tractorUnits
  /tractorUnits/{tractorUnitId}:
    get:
      tags:
        - Tractor Unit
      summary: Find tractor unit by ID
      parameters:
        - name: tractorUnitId
          in: path
          description: The tractor unit Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TractorUnit'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:tractorUnits
    put:
      tags:
        - Tractor Unit
      summary: Update/create tractor unit by ID
      parameters:
        - name: tractorUnitId
          in: path
          description: The tractor unit Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TractorUnitRequest'
        description: Update for the tractor unit
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TractorUnit'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:tractorUnits
  /trailers:
    get:
      tags:
        - Trailer
      summary: Get trailers list
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Trailer'
      security:
        - M2X_auth_application:
            - read:trailers
  /trailers/{trailerId}:
    get:
      tags:
        - Trailer
      summary: Find trailer by ID
      parameters:
        - name: trailerId
          in: path
          description: The trailer Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trailer'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:trailers
    put:
      tags:
        - Trailer
      summary: Update/create trailer by ID
      parameters:
        - name: trailerId
          in: path
          description: The trailer Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrailerRequest'
        description: Update for the trailer
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Trailer'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:trailers
  /drivers:
    get:
      tags:
        - Drivers
      summary: Get drivers list
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Driver'
      security:
        - M2X_auth_application:
            - read:drivers
  /drivers/{driverId}:
    get:
      tags:
        - Drivers
      summary: Find driver by ID
      parameters:
        - name: driverId
          in: path
          description: The driver Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:drivers
    put:
      tags:
        - Drivers
      summary: Update/create driver by ID
      parameters:
        - name: driverId
          in: path
          description: The driver Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DriverRequest'
        description: Update for the driver
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Driver'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:drivers
  /subcontractors:
    get:
      tags:
        - Subcontractors
      summary: Get subcontractors list
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Subcontractor'
      security:
        - M2X_auth_application:
            - read:subcontractors
  /subcontractors/{subcontractorId}:
    get:
      tags:
        - Subcontractors
      summary: Find subcontractor by ID
      parameters:
        - name: subcontractorId
          in: path
          description: The subcontractor Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subcontractor'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:subcontractors
    put:
      tags:
        - Subcontractors
      summary: Update/create subcontractor by ID
      parameters:
        - name: subcontractorId
          in: path
          description: The subcontractor Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubcontractorRequest'
        description: Update for the subcontractor
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subcontractor'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:subcontractors
  /isoContainers:
    get:
      tags:
        - ISO containers
      summary: Get ISO containers list
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/IsoContainer'
      security:
        - M2X_auth_application:
            - read:isoContainers
  /isoContainers/{isoContainerId}:
    get:
      tags:
        - ISO containers
      summary: Find ISO containers by ID
      parameters:
        - name: isoContainerId
          in: path
          description: The ISO containers Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IsoContainer'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:isoContainers
    put:
      tags:
        - ISO containers
      summary: Update/create ISO containers by ID
      parameters:
        - name: isoContainerId
          in: path
          description: The ISO containers Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IsoContainerRequest'
        description: Update for the ISO containers
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IsoContainer'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:isoContainers
  /depots/{depotId}:
    get:
      tags:
        - Locations
      summary: Find depot by ID
      parameters:
        - name: depotId
          in: path
          description: The depot Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Depot'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:locations
  /depots:
    get:
      tags:
        - Locations
      summary: Get paginated depots
      parameters:
        - name: lastDepotId
          in: query
          description: The last lastDepotId, query would start after that.
          required: false
          schema:
            type: string
        - name: pagesToReturn
          in: query
          description: Number of depots to return, default/max 20.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  lastDepotId:
                    type: string
                    description: Document from where the page starts
                  pagesToReturn:
                    type: integer
                    description: Page size
                  depots:
                    type: array
                    description: Queried locations
                    items:
                      $ref: '#/components/schemas/Depot'
                  latestDepotId:
                    type: integer
                    description: Last document in this batch
      security:
        - M2X_auth_application:
            - read:locations
  /locations/{locationId}:
    get:
      tags:
        - Locations
      summary: Find location by ID
      parameters:
        - name: locationId
          in: path
          description: The M2X internal location id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobLocation'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:locations
    put:
      tags:
        - Locations
      summary: Update/create location by ID
      parameters:
        - name: locationId
          in: path
          description: The M2X internal location id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/JobLocationRequest'
                - type: object
                  properties:
                    locationGroupUpsertRequest:
                      $ref: '#/components/schemas/LocationGroupUpsertRequest'
        description: Update for the location
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobLocation'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: The issue description
                  code:
                    type: string
                    description: The code for the issue
                    enum:
                      - INVALID_SCHEMA
                      - AGENT_NOT_FOUND
                      - LOCATION_GROUP_NOT_FOUND
                      - TOO_MANY_LOCATION_GROUPS
                      - LOCATION_POOL_NOT_FOUND
                      - INTERNAL_ERROR
      security:
        - M2X_auth_application:
            - write:locations
  /locations:
    get:
      tags:
        - Locations
      summary: Get paginated locations
      parameters:
        - name: lastLocationId
          in: query
          description: The last locationId, query would start after that.
          required: false
          schema:
            type: string
        - name: pagesToReturn
          in: query
          description: Number of locations to return, default/max 20.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  lastLocationId:
                    type: string
                    description: Document from where the page starts
                  pagesToReturn:
                    type: integer
                    description: Page size
                  locations:
                    type: array
                    description: Queried locations
                    items:
                      $ref: '#/components/schemas/JobLocation'
                  latestLocationId:
                    type: integer
                    description: Last document in this batch
      security:
        - M2X_auth_application:
            - read:locations
  /locationsWithStorage:
    get:
      tags:
        - Locations
      summary: Get paginated locations with more data (for example depots)
      parameters:
        - name: lastLocationId
          in: query
          description: The last locationId, query would start after that.
          required: false
          schema:
            type: string
        - name: pagesToReturn
          in: query
          description: Number of locations to return, default/max 20.
          required: false
          schema:
            type: integer
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  lastLocationId:
                    type: string
                    description: Document from where the page starts
                  pagesToReturn:
                    type: integer
                    description: Page size
                  locations:
                    type: array
                    description: Queried locations
                    items:
                      type: object
                      properties:
                        locationId:
                          type: string
                        location:
                          $ref: '#/components/schemas/JobLocation'
                        storages:
                          type: array
                          description: >-
                            Storage equipment (tanks) associated with the
                            location
                          items:
                            $ref: '#/components/schemas/Storage'
                  latestLocationId:
                    type: integer
                    description: Last document in this batch
      security:
        - M2X_auth_application:
            - read:locations
  /locations/search:
    post:
      tags:
        - Locations
      summary: Search locations
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                search:
                  type:
                    - string
                    - 'null'
                  description: A fuzzy search
                  default: null
                includeDisabled:
                  type: boolean
                  description: Whether to return disabled
                  default: false
                externalId:
                  type:
                    - string
                    - 'null'
                  description: Search by external Id
                  default: null
                name:
                  type:
                    - string
                    - 'null'
                  description: Search by name
                  default: null
                addressText:
                  type:
                    - string
                    - 'null'
                  description: Search by addressText
                  default: null
                pageFrom:
                  type: number
                  description: From which document number to start the page
                  default: 0
                pageSize:
                  type: number
                  description: How big the page should be
                  default: 15
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  from:
                    type: integer
                    description: Document from where the page starts
                  size:
                    type: integer
                    description: Page size
                  total:
                    type: integer
                    description: Total document count matching the query
                  hits:
                    type: array
                    items:
                      type: object
                      properties:
                        locationId:
                          type: string
                        addressText:
                          type: string
                        externalId:
                          type: string
                        name:
                          type: string
                        customerName:
                          type: string
                        latitude:
                          type: number
                        longitude:
                          type: number
                        disabled:
                          type: string
      security:
        - M2X_auth_application:
            - read:locations
  /geometryRegions:
    get:
      tags:
        - Locations
      summary: get all geometry regions
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/GeometryRegion'
      security:
        - M2X_auth_application:
            - read:locations
  /geometryRegions/{geometryRegionId}:
    get:
      tags:
        - Locations
      summary: Find geometry region by ID
      parameters:
        - name: geometryRegionId
          in: path
          description: The geometry region Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeometryRegion'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:locations
  /customers/{customerId}/locations:
    get:
      tags:
        - Locations
      summary: Find location belonging to a customer
      parameters:
        - name: customerId
          in: path
          description: The customer Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JobLocation'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:locations
  /locations/externalIdLookup/{externalId}:
    get:
      tags:
        - Locations
      summary: Find location with an externalId
      parameters:
        - name: externalId
          in: path
          description: The externalId
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JobLocation'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:locations
  /locations/propertyLookup/{propertyId}:
    get:
      tags:
        - Locations
      summary: Find location with an propertyId
      parameters:
        - name: propertyId
          in: path
          description: The property Id
          required: true
          schema:
            type: string
        - name: value
          in: query
          description: The property value
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JobLocation'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:locations
  /jobs/{jobId}:
    get:
      tags:
        - Jobs
      summary: Find job by ID
      parameters:
        - name: jobId
          in: path
          description: The job Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Job'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:jobs
  /jobs/{jobId}/attachment/{attachmentId}:
    get:
      tags:
        - Jobs
      summary: Find job attachment by ID
      parameters:
        - name: jobId
          in: path
          description: The job Id
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: The Attachment Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: job or attachment not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:jobs
  /jobs/{jobId}/tasks:
    get:
      tags:
        - Jobs
      summary: Get tasks associated with job
      parameters:
        - name: jobId
          in: path
          description: The job Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    shiftId:
                      type: string
                    tasks:
                      type: array
                      items:
                        $ref: '#/components/schemas/Task'
      security:
        - M2X_auth_application:
            - read:jobs
  /jobs/{jobId}/actionStepRecords:
    get:
      tags:
        - Jobs
      summary: Get all action step records associated with the job
      parameters:
        - name: jobId
          in: path
          description: The job Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ActionStepRecord'
      security:
        - M2X_auth_application:
            - read:jobs
  /jobs/{jobId}/notes/{noteId}:
    put:
      tags:
        - Jobs
      summary: Upsert job note
      parameters:
        - name: jobId
          in: path
          description: The job Id
          required: true
          schema:
            type: string
        - name: noteId
          in: path
          required: true
          schema:
            type: string
          description: The unique note identifier
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                notes:
                  type: string
      responses:
        '200':
          description: Successful operation
          content:
            text/plain:
              schema:
                type: string
                example: OK
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          description: Job not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:jobs
  /runs/activities:
    get:
      tags:
        - Runs
      summary: Query runs activities
      parameters:
        - name: start
          in: query
          required: true
          description: Start of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
        - name: end
          in: query
          required: true
          description: End of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunsActivities'
        '400':
          description: Invalid query
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - read:jobs
  /runs/pickups/{pickupId}:
    put:
      tags:
        - Runs
      summary: Upsert Pickup
      parameters:
        - name: pickupId
          in: path
          description: The unique pickup Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunPickupRequest'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: The issue description
                  code:
                    type: string
                    description: The code for the issue
                    enum:
                      - CUSTOMER_NOT_FOUND
                      - INVALID_SCHEMA
                      - PRODUCT_NOT_FOUND
                      - LOCATION_NOT_FOUND
                      - CONTENT_NOT_RESOLVED
                      - INTERNAL_ERROR
      security:
        - M2X_auth_application:
            - write:jobs
    delete:
      tags:
        - Runs
      summary: Delete Pickup
      parameters:
        - name: pickupId
          in: path
          description: The unique pickup Id
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '404':
          description: Could not find anything to delete
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:jobs
  /runs/pickups/collections/truckDairyPump/{collectionId}:
    get:
      tags:
        - Runs
      summary: Get collection by Id
      parameters:
        - name: collectionId
          in: path
          description: The unique Id of the collection
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunMeasurement'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:jobs
    put:
      tags:
        - Runs
      summary: Update/create collection by Id
      parameters:
        - name: collectionId
          in: path
          description: The unique Id of the collection to ensure idempotence
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RunMeasurementBase'
        description: Update for the collection
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RunMeasurement'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:jobs
  /fuel/activities:
    get:
      tags:
        - Fuel
      summary: Query fuel activities
      parameters:
        - name: start
          in: query
          required: true
          description: Start of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
        - name: end
          in: query
          required: true
          description: End of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuelActivities'
        '400':
          description: Invalid query
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/activities/vehicle/{vehicleId}:
    get:
      tags:
        - Fuel
      summary: Query fuel activities by vehicle
      parameters:
        - name: vehicleId
          in: path
          required: true
          description: Vehicle Id
          schema:
            type: string
        - name: start
          in: query
          required: true
          description: Start of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
        - name: end
          in: query
          required: true
          description: End of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuelActivities'
        '400':
          description: Invalid query
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/activities/shift/{shiftId}:
    get:
      tags:
        - Fuel
      summary: Query fuel activities by shift (Webhook DTO)
      parameters:
        - name: shiftId
          in: path
          required: true
          description: Shift Id
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuelShift'
        '400':
          description: Invalid query
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/deliveries:
    get:
      tags:
        - Fuel
      summary: Query deliveries
      parameters:
        - name: start
          in: query
          required: true
          description: Start of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
        - name: end
          in: query
          required: true
          description: End of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FuelDeliveryActivity'
        '400':
          description: Invalid query
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/deliveryRequests/{deliveryRequestId}:
    put:
      deprecated: true
      tags:
        - Fuel
      summary: Upsert Delivery Request
      description: Please use `/fuel/bulkTankDeliveryRequests/{deliveryRequestId}` instead
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelDeliveryRequestBulkTank'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/BulkTankDeliveryRequestBadRequest'
      security:
        - M2X_auth_application:
            - write:jobs
    delete:
      deprecated: true
      tags:
        - Fuel
      summary: Delete Delivery
      description: Please use `/fuel/bulkTankDeliveryRequests/{deliveryRequestId}` instead
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/DeliveryRequestCannotDelete'
        '404':
          $ref: '#/components/responses/DeliveryRequestCannotFindDelete'
      security:
        - M2X_auth_application:
            - write:jobs
    get:
      deprecated: true
      tags:
        - Fuel
      summary: Reads Delivery Request
      description: Please use `/fuel/bulkTankDeliveryRequests/{deliveryRequestId}` instead
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuelDeliveryRequestResolved'
        '404':
          $ref: '#/components/responses/DeliveryRequestNotFound'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/bulkTankDeliveryRequests/{deliveryRequestId}:
    put:
      security:
        - M2X_auth_application:
            - write:jobs
      tags:
        - Fuel
      summary: Upsert a delivery request that references tanks at the delivery location
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelDeliveryRequestBulkTank'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/BulkTankDeliveryRequestBadRequest'
    get:
      security:
        - M2X_auth_application:
            - read:jobs
      tags:
        - Fuel
      summary: Get a bulk tank delivery request by delivery request ID
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuelDeliveryRequestResolved'
        '404':
          $ref: '#/components/responses/DeliveryRequestNotFound'
    delete:
      security:
        - M2X_auth_application:
            - write:jobs
      tags:
        - Fuel
      summary: Delete bulk tank delivery request
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/DeliveryRequestCannotDelete'
        '404':
          $ref: '#/components/responses/DeliveryRequestCannotFindDelete'
  /fuel/bulkTanklessDeliveryRequests/{deliveryRequestId}:
    put:
      security:
        - M2X_auth_application:
            - write:jobs
      tags:
        - Fuel
      summary: >-
        Upsert a bulk delivery request that does not reference any tanks at the
        delivery location
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelDeliveryRequestBulkTankless'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/TanklessDeliveryRequestBadRequest'
    get:
      security:
        - M2X_auth_application:
            - read:jobs
      tags:
        - Fuel
      summary: >-
        Get a bulk delivery request that does not reference any tanks at the
        delivery location
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuelBulkTanklessDeliveryRequestResolved'
        '404':
          $ref: '#/components/responses/DeliveryRequestNotFound'
    delete:
      security:
        - M2X_auth_application:
            - write:jobs
      tags:
        - Fuel
      summary: >-
        Delete delivery request that does not reference any tanks at the
        delivery location
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/DeliveryRequestCannotDelete'
        '404':
          $ref: '#/components/responses/DeliveryRequestCannotFindDelete'
  /fuel/packagedDeliveryRequests/{deliveryRequestId}:
    put:
      tags:
        - Fuel
      summary: Upsert Delivery Request
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelPackagedDeliveryRequest'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/TanklessDeliveryRequestBadRequest'
      security:
        - M2X_auth_application:
            - write:jobs
    delete:
      tags:
        - Fuel
      summary: Delete Delivery
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/DeliveryRequestCannotDelete'
        '404':
          $ref: '#/components/responses/DeliveryRequestCannotFindDelete'
      security:
        - M2X_auth_application:
            - write:jobs
    get:
      tags:
        - Fuel
      summary: Reads Delivery Request
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuelPackagedDeliveryRequestResolved'
        '404':
          $ref: '#/components/responses/DeliveryRequestNotFound'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/deliveryRequests/{deliveryRequestId}/deliveries:
    get:
      tags:
        - Fuel
      summary: query deliveries belonging to a request
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FuelDeliveryActivity'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/packagedDeliveryRequests/{deliveryRequestId}/deliveries:
    get:
      tags:
        - Fuel
      summary: query deliveries belonging to a request
      parameters:
        - $ref: '#/components/parameters/deliveryRequestIdParam'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FuelDeliveryActivity'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/deliveries/{deliveryId}:
    put:
      tags:
        - Fuel
      summary: Upsert Delivery
      deprecated: true
      parameters:
        - name: deliveryId
          in: path
          description: The unique delivery Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelDeliveryRequestBulkTank'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/BulkTankDeliveryRequestBadRequest'
      security:
        - M2X_auth_application:
            - write:jobs
    delete:
      tags:
        - Fuel
      summary: Delete Delivery
      deprecated: true
      parameters:
        - name: deliveryId
          in: path
          description: The unique delivery Id
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '404':
          $ref: '#/components/responses/DeliveryRequestCannotFindDelete'
      security:
        - M2X_auth_application:
            - write:jobs
    get:
      tags:
        - Fuel
      summary: Reads Delivery
      parameters:
        - name: deliveryId
          in: path
          description: The unique delivery Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuelDeliveryActivity'
        '404':
          description: Could not find anything to read
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: no delivery exists with that id {deliveryId}
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/pickups:
    get:
      tags:
        - Fuel
      summary: Query pickups
      parameters:
        - name: start
          in: query
          required: true
          description: Start of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
        - name: end
          in: query
          required: true
          description: End of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FuelPickupActivity'
        '400':
          description: Invalid query
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/inventoryAdjustments:
    get:
      tags:
        - Fuel
      summary: Query pickups
      parameters:
        - name: start
          in: query
          required: true
          description: Start of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
        - name: end
          in: query
          required: true
          description: End of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FuelInventoryAdjustmentActivity'
        '400':
          description: Invalid query
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/dispatchGroup/{dispatchGroupId}:
    get:
      tags:
        - Fuel
      summary: Query pickups, inventory adjustments, and deliveries for a trip
      parameters:
        - name: dispatchGroupId
          in: path
          required: true
          description: GroupId to inspect
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FuelDispatchGroupActivities'
        '400':
          description: Invalid query
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - read:jobs
  /fuel/locations/{locationId}/storages:
    get:
      tags:
        - Fuel
      summary: Query storages for a location
      parameters:
        - name: locationId
          in: path
          required: true
          description: locationId to inspect
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FuelStorage'
      security:
        - M2X_auth_application:
            - read:locations
  /fuel/locations/{locationId}/storages/{storageId}:
    put:
      tags:
        - Fuel
      summary: Create/update storage for a location
      parameters:
        - name: locationId
          in: path
          required: true
          description: locationId to use
          schema:
            type: string
        - name: storageId
          in: path
          required: true
          description: StorageId to use
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelStorageRequest'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: The issue description
                  code:
                    type: string
                    description: The code for the issue
                    enum:
                      - INVALID_SCHEMA
                      - PRODUCT_NOT_FOUND
                      - LOCATION_NOT_FOUND
      security:
        - M2X_auth_application:
            - write:locations
  /fuel/locations/{locationId}/storages/{storageId}/measurement/{measurementId}:
    put:
      tags:
        - Fuel
      summary: Create/update a measurement for a storage
      parameters:
        - name: locationId
          in: path
          required: true
          description: locationId to use
          schema:
            type: string
        - name: storageId
          in: path
          required: true
          description: StorageId to use
          schema:
            type: string
        - name: measurementId
          in: path
          required: true
          description: Unique identifier of the measurement
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelStorageMeasurementRequest'
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: The issue description
                  code:
                    type: string
                    description: The code for the issue
                    enum:
                      - INVALID_SCHEMA
                      - PRODUCT_NOT_FOUND
                      - LOCATION_NOT_FOUND
                      - INVALID_MEASUREMENT
      security:
        - M2X_auth_application:
            - write:locations
  /customers:
    get:
      tags:
        - Customers
      summary: Get all customers
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Customer'
      security:
        - M2X_auth_application:
            - read:customers
    post:
      tags:
        - Customers
      summary: Create new customer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '400':
          description: Bad request
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:customers
  /customers/{customerId}:
    get:
      tags:
        - Customers
      summary: Get customer by id
      parameters:
        - name: customerId
          in: path
          description: The customer Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:customers
    put:
      tags:
        - Customers
      summary: Update/create customer by id
      parameters:
        - name: customerId
          in: path
          description: The customer Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Customer'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:customers
  /customers/bulk:
    post:
      tags:
        - Customers
      summary: Update/create customers bulk
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                  - id
                  - customer
                properties:
                  id:
                    type: string
                  customer:
                    $ref: '#/components/schemas/CustomerRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:customers
  /customers/search:
    post:
      tags:
        - Customers
      summary: Search customers
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                search:
                  type:
                    - string
                    - 'null'
                  description: A fuzzy search
                  default: null
                includeDisabled:
                  type: boolean
                  description: Whether to return disabled
                  default: false
                externalId:
                  type:
                    - string
                    - 'null'
                  description: Search by external Id
                  default: null
                name:
                  type:
                    - string
                    - 'null'
                  description: Search by name
                  default: null
                pageFrom:
                  type: number
                  description: From which document number to start the page
                  default: 0
                pageSize:
                  type: number
                  description: How big the page should be
                  default: 20
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  from:
                    type: integer
                    description: Document from where the page starts
                  size:
                    type: integer
                    description: Page size
                  total:
                    type: integer
                    description: Total document count matching the query
                  hits:
                    type: array
                    items:
                      type: object
                      properties:
                        customerId:
                          type: string
                        postalAddress:
                          type: string
                        externalId:
                          type: string
                        name:
                          type: string
                        disabled:
                          type: string
      security:
        - M2X_auth_application:
            - read:locations
  /products:
    get:
      tags:
        - Products
      summary: Get all products
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Product'
      security:
        - M2X_auth_application:
            - read:products
    post:
      tags:
        - Products
      summary: Create new product
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:products
  /products/{productCodeId}:
    get:
      tags:
        - Products
      summary: Get product by id
      parameters:
        - name: productCodeId
          in: path
          description: The product code Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:products
    put:
      tags:
        - Products
      summary: Update/create product by id
      parameters:
        - name: productCodeId
          in: path
          description: The product code Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProductRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:products
  /products/bulk:
    post:
      tags:
        - Products
      summary: Update/create products bulk
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                  - id
                  - product
                properties:
                  id:
                    type: string
                  product:
                    $ref: '#/components/schemas/ProductRequest'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:products
  /billingGroups:
    get:
      tags:
        - Billing Groups
      summary: Get a list of billing groups
      parameters:
        - in: query
          name: start
          description: Start of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
        - in: query
          name: end
          description: End of the queried interval (YYYY-MM-DD)
          schema:
            type: string
            format: date
        - in: query
          name: state
          description: State filter
          schema:
            type: string
            enum:
              - Booked
              - Started
              - Delivered
              - Accepted
              - Invoiced
              - Paid
        - in: query
          name: customerId
          description: Customer filter
          schema:
            type: string
        - in: query
          name: inactive
          description: Search for inactive billingGroups
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BillingGroup'
      security:
        - M2X_auth_application:
            - read:billingGroups
  /billingGroups/bulkStatusUpdate:
    post:
      tags:
        - Billing Groups
      summary: Force bulk update billing group status, can make a mess, use at own risk
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                  - billingGroupId
                properties:
                  billingGroupId:
                    type: string
                  deleteStatus:
                    type: boolean
                    default: false
                    description: Deletes the manual status on the billing group
                  status:
                    type: string
                    enum:
                      - Booked
                      - Started
                      - Delivered
                      - Accepted
                      - Invoiced
                      - Paid
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:billingGroups
  /billingGroups/{billingGroupId}:
    get:
      tags:
        - Billing Groups
      summary: Get billing group by id
      parameters:
        - name: billingGroupId
          in: path
          description: The billing group Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingGroup'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:billingGroups
  /billingGroups/{billingGroupId}/status:
    put:
      tags:
        - Billing Groups
      summary: Force update billing group status by id
      parameters:
        - name: billingGroupId
          in: path
          description: The billing group Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                status:
                  type: string
                  enum:
                    - Booked
                    - Started
                    - Delivered
                    - Accepted
                    - Invoiced
                    - Paid
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:billingGroups
    delete:
      tags:
        - Billing Groups
      summary: Remove forced update billing group status by id
      parameters:
        - name: billingGroupId
          in: path
          description: The billing group Id
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:billingGroups
  /billingGroups/{billingGroupId}/details:
    get:
      tags:
        - Billing Groups
      summary: Get billing group by id
      parameters:
        - name: billingGroupId
          in: path
          description: The billing group Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingGroupDetails'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:billingGroups
  /invoices:
    get:
      tags:
        - Billing Groups
      summary: Get a list of invoices
      parameters:
        - in: query
          name: createdSince
          description: Get invoices created after this day
          schema:
            type: string
            format: date
        - in: query
          name: updatedSince
          description: Get invoices created after this day
          schema:
            type: string
            format: date
        - in: query
          name: limit
          description: Max number of invoices returned
          schema:
            type: integer
            default: 100
        - in: query
          name: page
          description: Page of invoices returned
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    billingGroupIds:
                      type: array
                      items:
                        type: string
                    created:
                      type: string
                      format: date-time
                    updated:
                      type: string
                      format: date-time
                    status:
                      type: string
                    invoicedBy:
                      $ref: '#/components/schemas/User'
                    id:
                      type: string
                    invoiceDate:
                      type: string
      security:
        - M2X_auth_application:
            - read:billingGroups
  /invoices/{invoiceId}:
    get:
      tags:
        - Billing Groups
      summary: Get invoice by id
      parameters:
        - name: invoiceId
          in: path
          description: The invoice Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Invoice'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:billingGroups
  /invoicesBillingGroupDetailsSnapshot/{invoiceId}:
    get:
      tags:
        - Billing Groups
      summary: Get invoice billing group details snapshot by id
      parameters:
        - name: invoiceId
          in: path
          description: The invoice Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  billingGroupDetails:
                    type: array
                    items:
                      $ref: '#/components/schemas/BillingGroupDetails'
                  created:
                    type: string
                    format: date-time
                  invoicedBy:
                    $ref: '#/components/schemas/User'
                  updated:
                    type: string
                    format: date-time
                  status:
                    type: string
                  id:
                    type: string
                  invoiceDate:
                    type: string
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:billingGroups
  /vehicleTimelineStatements/{vehicleTimelineStatementId}:
    get:
      tags:
        - Vehicle Execution Statements
      summary: Find vehicle timeline statement by ID
      parameters:
        - name: vehicleTimelineStatementId
          in: path
          description: The vehicle execution statement Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VehicleTimelineStatement'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:jobs
  /vehicleTimelineStatementsAllocations/{vehicleTimelineStatementsAllocationId}:
    get:
      tags:
        - Vehicle Execution Statements
      summary: Find vehicle timeline statement allocation by ID
      parameters:
        - name: vehicleTimelineStatementsAllocationId
          in: path
          description: The vehicle execution statements allocation ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VehicleTimelineStatementsAllocation'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:jobs
  /vehicleTimelineStatementsAllocations/{vehicleTimelineStatementsAllocationId}/details:
    get:
      tags:
        - Vehicle Execution Statements
      summary: Find vehicle timeline statement allocation details by ID
      parameters:
        - name: vehicleTimelineStatementsAllocationId
          in: path
          description: The vehicle execution statements allocation ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/VehicleTimelineStatementsAllocationDetails
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:jobs
  /carrierBookings:
    get:
      tags:
        - Carrier Bookings
      summary: Get bookings list
      parameters:
        - in: query
          name: requestedDay
          description: Day required (YYYY-MM-DD), default to today if nothing specified
          schema:
            type: string
            format: date
        - in: query
          name: requestedWeek
          description: ISO week required (YYYY-WW)
          schema:
            type: string
        - in: query
          name: requestedWeekStartingSunday
          description: Sunday week required (YYYY-WW)
          schema:
            type: string
        - in: query
          name: requestedMonth
          description: Month required (YYYY-MM)
          schema:
            type: string
        - in: query
          name: selectPickup
          description: Whether to select the pickup or delivery date
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Booking'
      security:
        - M2X_auth_application:
            - read:bookings
  /carrierBookings/{bookingId}:
    get:
      tags:
        - Carrier Bookings
      summary: Find booking by ID
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Booking'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:bookings
  /carrierBookings/{bookingId}/acceptance:
    put:
      tags:
        - Carrier Bookings
      summary: Accept or reject a booking
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - acceptance
              properties:
                acceptance:
                  type: boolean
                  description: Whether the booking is accepted or rejected by the carrier
                  default: false
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/acknowledge:
    put:
      tags:
        - Carrier Bookings
      summary: >-
        Let the customer know that a someone has seen the latest changes on the
        booking
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/events:
    get:
      tags:
        - Carrier Bookings
      summary: Get all events associated with the booking
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}:
    get:
      tags:
        - Carrier Bookings
      summary: Get all events associated with the transport order
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:bookings
    delete:
      tags:
        - Carrier Bookings
      summary: Marks all events associated with the transport order as cancelled
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/pickupEta:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates the pickup ETA for a transport order
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityEta'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/arrivedAtPickup:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates that the vehicle arrived at the pickup location
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArrivedAtActivityLocation'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/pickup:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates that the vehicle picked up the goods
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityExecution'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/gateIn:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates that a container has Gated In to a location
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityGateInteraction'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: The issue description
                  code:
                    type: string
                    description: The code for the issue
                    enum:
                      - INVALID_SCHEMA
                      - INTERNAL_ERROR
        '401':
          description: Identity issue
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: missing scope
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/pickup/upload/signature:
    put:
      tags:
        - Carrier Bookings
      summary: Uploads a digital signature against the pickup
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                signature:
                  type: string
                  format: binary
                  description: >-
                    Supported content types: application/pdf, image/jpeg,
                    image/png
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/pickup/upload/attachment/{attachmentId}:
    put:
      tags:
        - Carrier Bookings
      summary: Uploads an attachment against the pickup
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: The Attachment Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                description:
                  type: string
                attachment:
                  type: string
                  format: binary
                  description: >-
                    Supported content types: application/pdf, image/jpeg,
                    image/png
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/deliveryEta:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates the delivery ETA for a transport order
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityEta'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/arrivedAtDelivery:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates that the vehicle arrived at the delivery location
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ArrivedAtActivityLocation'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/delivery:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates that the vehicle delivered the goods
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityExecution'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/gateOut:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates that a container has Gated Out to a location
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityGateInteraction'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: The issue description
                  code:
                    type: string
                    description: The code for the issue
                    enum:
                      - INVALID_SCHEMA
                      - INTERNAL_ERROR
        '401':
          description: Identity issue
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: missing scope
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/exceptionFlag:
    put:
      tags:
        - Carrier Bookings
      summary: >-
        Communicates that an exceptional scenario has been identified, for
        example, being unable to deliver to port
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityExceptionFlag'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: The issue description
                  code:
                    type: string
                    description: The code for the issue
                    enum:
                      - INVALID_SCHEMA
                      - INTERNAL_ERROR
        '401':
          description: Identity issue
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: missing scope
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/delivery/upload/signature:
    put:
      tags:
        - Carrier Bookings
      summary: Uploads a digital signature against the delivery
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                name:
                  type: string
                signature:
                  type: string
                  format: binary
                  description: >-
                    Supported content types: application/pdf, image/jpeg,
                    image/png
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/delivery/upload/attachment/{attachmentId}:
    put:
      tags:
        - Carrier Bookings
      summary: Uploads an attachment against the delivery
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: The Attachment Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                description:
                  type: string
                attachment:
                  type: string
                  format: binary
                  description: >-
                    Supported content types: application/pdf, image/jpeg,
                    image/png
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/leg/{legId}/vehicleAssignment:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates that a vehicle has been assigned to the transport order
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
        - name: legId
          in: path
          description: >-
            The Leg Id, sub unit of a transport order, describing one vehicle
            movement.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleAssignment'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/leg/{legId}/offload:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates that the product was offloaded by the vehicle
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
        - name: legId
          in: path
          description: >-
            The Leg Id, sub unit of a transport order, describing one vehicle
            movement.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityExecution'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /carrierBookings/{bookingId}/transportOrder/{transportOrderId}/leg/{legId}/uplift:
    put:
      tags:
        - Carrier Bookings
      summary: Communicates that the product was uplifted by the vehicle
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: transportOrderId
          in: path
          description: >-
            The Transport Order Id, carrier execution planning unit no more than
            a truckload, containing exactly one pickup and one delivery
          required: true
          schema:
            type: string
        - name: legId
          in: path
          description: >-
            The Leg Id, sub unit of a transport order, describing one vehicle
            movement.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityExecution'
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /bookings:
    get:
      tags:
        - Bookings
      summary: Get bookings list
      parameters:
        - in: query
          name: requestedDay
          description: Day required (YYYY-MM-DD), default to today if nothing specified
          schema:
            type: string
            format: date
        - in: query
          name: requestedWeek
          description: ISO week required (YYYY-WW)
          schema:
            type: string
        - in: query
          name: requestedWeekStartingSunday
          description: Sunday week required (YYYY-WW)
          schema:
            type: string
        - in: query
          name: requestedMonth
          description: Month required (YYYY-MM)
          schema:
            type: string
        - in: query
          name: selectPickup
          description: Whether to select the pickup or delivery date
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Booking'
      security:
        - M2X_auth_application:
            - read:bookings
    post:
      deprecated: true
      tags:
        - Bookings
      summary: DEPRECATED, use PUT instead - create new booking
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                booking:
                  $ref: '#/components/schemas/BookingRequest'
                requestTimestamp:
                  type: string
                  format: date-time
                  description: >-
                    Request timestamp, useful to discard stale updates than were
                    made offline and came online later
                mappingRequests:
                  $ref: '#/components/schemas/BookingMappingRequest'
        description: Update for the booking
        required: true
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    example: XYZ123
                  id:
                    type: string
                    example: ABC123-example-1737580145879
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:bookings
  /bookings/{bookingId}:
    get:
      tags:
        - Bookings
      summary: Find booking by ID
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Booking'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:bookings
    put:
      tags:
        - Bookings
      summary: Update/create booking by ID
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                booking:
                  $ref: '#/components/schemas/BookingRequest'
                requestTimestamp:
                  type: string
                  format: date-time
                  description: >-
                    Request timestamp, useful to discard stale updates than were
                    made offline and came online later
                mappingRequests:
                  $ref: '#/components/schemas/BookingMappingRequest'
        description: Update for the booking
        required: true
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    example: XYZ123
                  id:
                    type: string
                    example: ABC123-example-1737580145879
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:bookings
    delete:
      tags:
        - Bookings
      summary: Delete booking by ID
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    example: ABC123
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:bookings
  /bookings/bulk:
    post:
      deprecated: true
      tags:
        - Bookings
      summary: DEPRECATED, use PUT instead - update/create bookings bulk
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                  - id
                  - booking
                  - mappingRequests
                properties:
                  id:
                    type: string
                  booking:
                    $ref: '#/components/schemas/BookingRequest'
                  requestTimestamp:
                    type: string
                    format: date-time
                    description: >-
                      Request timestamp, useful to discard stale updates than
                      were made offline and came online later
                  mappingRequests:
                    $ref: '#/components/schemas/BookingMappingRequest'
                  cancel:
                    type: boolean
      responses:
        '202':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:bookings
  /bookings/requestsStatus/batch/{batchId}:
    get:
      tags:
        - Bookings
      summary: Get the integration status of a batch
      parameters:
        - name: batchId
          in: path
          description: The batch Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BookingRequestIntegrationStatus'
      security:
        - M2X_auth_application:
            - read:bookings
  /bookings/requestsStatus/booking/{bookingId}:
    get:
      tags:
        - Bookings
      summary: Get the integration status of a booking
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BookingRequestIntegrationStatus'
      security:
        - M2X_auth_application:
            - read:bookings
  /bookings/{bookingId}/events:
    get:
      tags:
        - Bookings
      summary: Get events in booking by bookingId
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
      security:
        - M2X_auth_application:
            - read:bookings
    post:
      deprecated: true
      tags:
        - Bookings
      summary: DEPRECATED, use PUT instead - create and event for a booking
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookingEventRequest'
        description: Event
        required: true
      responses:
        '202':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:bookings
  /bookings/{bookingId}/events/{eventId}:
    get:
      tags:
        - Bookings
      summary: Find event by ID
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: eventId
          in: path
          description: The event Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingEvent'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:bookings
    put:
      tags:
        - Bookings
      summary: Update/create event by ID
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: eventId
          in: path
          description: The event Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookingEventRequest'
        description: Update for the booking
        required: true
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    example: XYZ123
                  id:
                    type: string
                    example: ABC123-example-1737580145879
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:bookings
    delete:
      tags:
        - Bookings
      summary: Mark event as canceled by ID
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: eventId
          in: path
          description: The event Id
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '202':
          description: Accepted
        '404':
          description: No event to delete
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /bookings/{bookingId}/attachments:
    get:
      tags:
        - Bookings
      summary: Get booking attachments metadata
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    attachmentId:
                      type: string
                    fileName:
                      type: string
                    isPublic:
                      type: string
                    canDelete:
                      type: string
                    contentType:
                      type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:bookings
  /bookings/{bookingId}/attachments/{attachmentId}:
    put:
      tags:
        - Bookings
      summary: Add attachment to booking
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: Accepts A–Z a–z 0–9 - _ . ! ~ * ' ( )
          required: true
          schema:
            type: string
        - name: isPublic
          in: query
          description: Whether the attachment should be shared with carrier
          required: false
          schema:
            type: boolean
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                attachment:
                  type: string
                  format: binary
                  description: >-
                    Supported content types: application/pdf, image/jpeg,
                    image/png
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          description: Booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
    delete:
      tags:
        - Bookings
      summary: Delete booking attachment by ID
      parameters:
        - name: bookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: Id of the attachment to delete
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  bookingId:
                    type: string
                    example: JBO373-dbvh1tPVIggQipFAffNa-1700417071825
                  attachmentId:
                    type: string
                    example: BOOKING_ATTACHMENT_001
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:bookings
  /customerBookings/{customerBookingId}:
    get:
      tags:
        - Customer Bookings
      summary: Find customer booking by ID
      parameters:
        - name: customerBookingId
          in: path
          description: The customer booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CustomerBooking'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: customer booking ABC123 not found
      security:
        - M2X_auth_application:
            - read:customerBookings
    put:
      tags:
        - Customer Bookings
      summary: Update/create customer booking by ID
      parameters:
        - name: customerBookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                booking:
                  $ref: '#/components/schemas/CustomerBookingRequest'
                mappingRequests:
                  $ref: '#/components/schemas/CustomerBookingMappingRequest'
        description: Update for the customer booking
        required: true
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:customerBookings
    delete:
      tags:
        - Customer Bookings
      summary: Delete customer booking by ID
      parameters:
        - name: customerBookingId
          in: path
          description: The customer booking Id
          required: true
          schema:
            type: string
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:customerBookings
  /customerBookings/carrier/{customerBookingId}:
    put:
      tags:
        - Customer Bookings
      summary: Update/create customer booking by ID (by carrier)
      parameters:
        - name: customerBookingId
          in: path
          description: The booking Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                booking:
                  $ref: '#/components/schemas/CustomerBookingRequest'
                mappingRequests:
                  $ref: '#/components/schemas/CarrierCustomerBookingMappingRequest'
        description: Update for the customer booking
        required: true
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:customerBookings
  /corporatePlanning/supplies/{supplyId}:
    put:
      tags:
        - Corporate Planning
      summary: Update/create supply by ID
      parameters:
        - name: supplyId
          in: path
          description: The supply Id
          required: true
          schema:
            type: string
        - name: sync
          in: query
          description: Whether mapping errors should be returned synchronously
          required: false
          schema:
            type: boolean
        - name: reprocessId
          in: query
          description: >-
            Used to retry a request that fail and clear the issues in the
            integration issues
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                supply:
                  $ref: '#/components/schemas/CorporateNodeRequest'
                requestTimestamp:
                  type: string
                  format: date-time
                  description: >-
                    Request timestamp, useful to discard stale updates than were
                    made offline and came online later
                mappingRequests:
                  $ref: '#/components/schemas/CorporateNodeMappingRequest'
        description: Update for the supply
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    example: XYZ123
                  id:
                    type: string
                    example: ABC123
                  reprocessId:
                    type: string
                    example: reprocess123
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:bookings
  /corporatePlanning/demands/{demandId}:
    put:
      tags:
        - Corporate Planning
      summary: Update/create demand by ID
      parameters:
        - name: demandId
          in: path
          description: The demand Id
          required: true
          schema:
            type: string
        - name: sync
          in: query
          description: Whether mapping errors should be returned synchronously
          required: false
          schema:
            type: boolean
        - name: reprocessId
          in: query
          description: >-
            Used to retry a request that fail and clear the issues in the
            integration issues
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                demand:
                  $ref: '#/components/schemas/CorporateNodeRequest'
                requestTimestamp:
                  type: string
                  format: date-time
                  description: >-
                    Request timestamp, useful to discard stale updates than were
                    made offline and came online later
                mappingRequests:
                  $ref: '#/components/schemas/CorporateNodeMappingRequest'
        description: Update for the demand
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    example: XYZ123
                  id:
                    type: string
                    example: ABC123
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:bookings
  /offers:
    get:
      tags:
        - Offers
      summary: Get offers list
      parameters:
        - in: query
          name: start
          description: >-
            RFC3339 date time start of the required interval, default to start
            of the week
          schema:
            type: string
            format: date-time
            description: RFC3339 date time of cart
        - in: query
          name: end
          description: >-
            RFC3339 date time end of the required interval, default to end of
            the week
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Offer'
      security:
        - M2X_auth_application:
            - read:offers
    post:
      tags:
        - Offers
      summary: Create new offer
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                offer:
                  $ref: '#/components/schemas/OfferRequest'
                mappingRequests:
                  $ref: '#/components/schemas/OfferMappingRequest'
                cancel:
                  type: boolean
                settled:
                  type: boolean
        description: Update for the booking
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    example: XYZ123
                  id:
                    type: string
                    example: ABC123
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:offers
  /offers/{offerId}:
    get:
      tags:
        - Offers
      summary: Find offer by ID
      parameters:
        - name: offerId
          in: path
          description: The offer Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Offer'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:offers
    put:
      tags:
        - Offers
      summary: Update/create offer by ID
      parameters:
        - name: offerId
          in: path
          description: The offer Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                offer:
                  $ref: '#/components/schemas/OfferRequest'
                mappingRequests:
                  $ref: '#/components/schemas/OfferMappingRequest'
                cancel:
                  type: boolean
                settled:
                  type: boolean
        description: Update for the offer
        required: true
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    example: XYZ123
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:offers
    delete:
      tags:
        - Offers
      summary: Delete offer by ID
      parameters:
        - name: offerId
          in: path
          description: The offer Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  batchId:
                    type: string
                    example: XYZ123
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:offers
  /offers/bulk:
    post:
      tags:
        - Offers
      summary: Update/create offers bulk
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                required:
                  - id
                  - offer
                  - mappingRequests
                properties:
                  id:
                    type: string
                  offer:
                    $ref: '#/components/schemas/OfferRequest'
                  mappingRequests:
                    $ref: '#/components/schemas/OfferMappingRequest'
                  cancel:
                    type: boolean
                  settled:
                    type: boolean
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkResponse'
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:offers
  /fulfilmentRequests:
    post:
      tags:
        - Fulfilment Requests
      summary: Create new fulfilment request
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fulfilmentRequest:
                  $ref: '#/components/schemas/FulfilmentRequestRequest'
                mappingRequests:
                  $ref: '#/components/schemas/FulfilmentRequestMappingRequest'
        description: Update for the fulfilment request
        required: true
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:fulfilment
  /fulfilmentRequests/{fulfilmentRequestId}:
    get:
      tags:
        - Fulfilment Requests
      summary: Find fulfilment request by ID
      parameters:
        - name: fulfilmentRequestId
          in: path
          description: The fulfilment request Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FulfilmentRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:fulfilment
    put:
      tags:
        - Fulfilment Requests
      summary: Update/create fulfilment request by ID
      parameters:
        - name: fulfilmentRequestId
          in: path
          description: The fulfilment request Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                fulfilmentRequest:
                  $ref: '#/components/schemas/FulfilmentRequestRequest'
                mappingRequests:
                  $ref: '#/components/schemas/FulfilmentRequestMappingRequest'
        description: Update for the fulfilment request
        required: true
      responses:
        '200':
          $ref: '#/components/responses/Success'
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:fulfilment
  /fulfilmentRequests/{fulfilmentRequestId}/siteFulfilments:
    get:
      tags:
        - Fulfilment Requests
      summary: Find site fulfilment request by fulfilment request ID
      parameters:
        - name: fulfilmentRequestId
          in: path
          description: The fulfilment request Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SiteFulfilment'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:fulfilment
  /jobs/{jobId}/measurements/weighbridge/{measurementId}:
    get:
      tags:
        - Jobs
      summary: Get the weighbridge measurement for a given job ID and measurement ID
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
          description: The unique job identifier
        - name: measurementId
          in: path
          required: true
          schema:
            type: string
          description: The unique measurement identifier
      responses:
        '200':
          description: Successful request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WeighbridgeMeasurement'
      security:
        - M2X_auth_application:
            - read:jobs
    put:
      summary: >-
        Create (or edit) the weighbridge measurement for a given job ID and
        measurement ID
      tags:
        - Jobs
      parameters:
        - name: jobId
          in: path
          required: true
          schema:
            type: string
          description: The unique job identifier
        - name: measurementId
          in: path
          required: true
          schema:
            type: string
          description: The unique measurement identifier
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WeighbridgeMeasurement'
            example:
              unit: tonne
              netWeight: 31000
              tareWeight: 10000
              grossWeight: 41000
      responses:
        '200':
          description: Weighbridge measurement modified successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WeighbridgeMeasurement'
              example:
                unit: tonne
                netWeight: 31000
                tareWeight: 10000
                grossWeight: 41000
        '201':
          description: Weighbridge measurement created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WeighbridgeMeasurement'
              example:
                unit: tonne
                netWeight: 31000
                tareWeight: 10000
                grossWeight: 41000
      security:
        - M2X_auth_application:
            - write:jobs
  /generalConsignments/{consignmentId}:
    get:
      tags:
        - General Consignments
      summary: Get consignment by id (Webhook DTO)
      parameters:
        - name: consignmentId
          in: path
          description: Internal M2X consignment id
          required: true
          schema:
            type: string
        - name: includeLegDetails
          in: query
          description: Whether or not to include detailed consignment leg information
          required: false
          schema:
            type: boolean
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeneralConsignment'
        '404':
          description: Consignment not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:jobs
    delete:
      tags:
        - General Consignments
      summary: Delete consignment by id
      parameters:
        - name: consignmentId
          in: path
          description: Internal M2X consignment id
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Successful operation
          content:
            text/plain:
              schema:
                type: string
                example: Accepted
        '404':
          description: Consignment not found
          content:
            text/plain:
              schema:
                type: string
                example: Not Found
      security:
        - M2X_auth_application:
            - write:jobs
  /generalConsignments/{consignmentIntegrationId}:
    put:
      tags:
        - General Consignments
      summary: Create new consignment
      parameters:
        - name: consignmentIntegrationId
          in: path
          description: M2X consignment integration id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                generalConsignment:
                  $ref: '#/components/schemas/GeneralConsignmentRequest'
                mappingRequests:
                  $ref: '#/components/schemas/GeneralConsignmentRequestMappingRequest'
        description: New consignment data
        required: true
      responses:
        '201':
          description: Successful creation
          content:
            application/json:
              schema:
                type: object
                properties:
                  consignmentId:
                    type: string
                    description: Internal M2X consignment id
                    example: TGX854-6OU9Ns9xm9E4JxP1YJYs-1670743772224
                required:
                  - consignmentId
        '202':
          description: >-
            Request is successfully accepted, however, the consignment with the
            same integration id has already existed
          content:
            application/json:
              schema:
                type: object
                properties:
                  consignmentId:
                    type: string
                    description: Internal M2X consignment id
                    example: TGX854-6OU9Ns9xm9E4JxP1YJYs-1670743772224
                required:
                  - consignmentId
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  errors:
                    type: array
                    description: Issues encountered
                    items:
                      type: string
                      description: The issue description
                      example: >-
                        Require at least one of locationId, addressText,
                        externalId or locationName
      security:
        - M2X_auth_application:
            - write:jobs
  /largeContracts/{contractId}:
    get:
      tags:
        - Carrier Large Contracts
      summary: Get a carrier large contract by contract id
      parameters:
        - name: contractId
          in: path
          description: M2X large contract id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CarrierLargeContract'
        '404':
          description: Carrier large contract not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:largeContracts
    put:
      tags:
        - Carrier Large Contracts
      summary: Update/create carrier large contract by ID
      parameters:
        - name: contractId
          in: path
          description: M2X large contract id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                contract:
                  $ref: '#/components/schemas/CarrierLargeContractRequest'
                mappingRequests:
                  $ref: '#/components/schemas/CarrierLargeContractMappingRequests'
              required:
                - contract
                - mappingRequests
        description: Create or update a large contract
        required: true
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  contractId:
                    type: string
                    example: ABC123-example-1697761533817
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:largeContracts
    delete:
      tags:
        - Carrier Large Contracts
      summary: Delete carrier large contract by ID
      parameters:
        - name: contractId
          in: path
          description: M2X large contract id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  contractId:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:largeContracts
  /orders:
    get:
      tags:
        - Carrier Orders
      summary: Get carrier orders
      parameters:
        - name: createdFrom
          in: query
          description: Range creation date from
          required: true
          schema:
            type: string
            format: date-time
        - name: createdTo
          in: query
          description: Range creation date to
          required: true
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CarrierOrder'
        '404':
          description: Carrier order not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:orders
  /orders/{orderId}:
    get:
      tags:
        - Carrier Orders
      summary: Get a carrier order by id
      parameters:
        - name: orderId
          in: path
          description: Internal M2X order id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CarrierOrder'
        '404':
          description: Carrier order not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:orders
    put:
      tags:
        - Carrier Orders
      summary: Update/create carrier order by ID
      parameters:
        - name: orderId
          in: path
          description: M2X order id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                order:
                  $ref: '#/components/schemas/CarrierOrderRequest'
                mappingRequests:
                  $ref: '#/components/schemas/CarrierOrderMappingRequests'
              required:
                - order
                - mappingRequests
        description: Create or update an order
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  orderId:
                    type: string
                    example: ABC123-Ilon3tVMlqfCVLC8wZFy-1698357659017
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:orders
    delete:
      tags:
        - Carrier Orders
      summary: Delete a carrier order by ID
      parameters:
        - name: orderId
          in: path
          description: M2X order id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  orderId:
                    type: string
                    example: ABC123-example-1737580145879
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:orders
  /orders/{orderId}/attachment/{attachmentId}:
    get:
      tags:
        - Carrier Orders
      summary: get order attachment by Id
      parameters:
        - name: orderId
          in: path
          description: M2X order id
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: The Attachment Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '404':
          description: order or attachment not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:orders
    put:
      tags:
        - Carrier Orders
      summary: Upload order attachment
      parameters:
        - name: orderId
          in: path
          description: M2X order ID
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: The Attachment ID. Accepts A–Z a–z 0–9 - _ . ! ~ * ' ( )
          required: true
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                attachment:
                  type: string
                  format: binary
                  description: >-
                    Supported content types: application/pdf, image/jpeg,
                    image/png
              required:
                - attachment
        description: Attachment file
        required: true
      responses:
        '204':
          description: Attachment uploaded successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:orders
    delete:
      tags:
        - Carrier Orders
      summary: Delete order attachment
      parameters:
        - name: orderId
          in: path
          description: M2X order ID
          required: true
          schema:
            type: string
        - name: attachmentId
          in: path
          description: The Attachment ID
          required: true
          schema:
            type: string
      responses:
        '204':
          description: Attachment deleted successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:orders
  /masterBookings/{masterBookingId}:
    get:
      tags:
        - Master Bookings
      summary: Get a master booking by id
      parameters:
        - name: masterBookingId
          in: path
          description: Internal M2X master booking id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MasterBooking'
        '404':
          description: Corporate master booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:masterBookings
    put:
      tags:
        - Master Bookings
      summary: update/create master booking by ID
      parameters:
        - name: masterBookingId
          in: path
          description: M2X master booking id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MasterBookingRequest'
        description: Create or update a master booking
        required: true
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  masterBookingId:
                    type: string
                    description: master booking id
        '400':
          $ref: '#/components/responses/MasterBookingRequestBadRequest'
      security:
        - M2X_auth_application:
            - write:masterBookings
    delete:
      tags:
        - Master Bookings
      summary: delete a master booking by ID
      parameters:
        - name: masterBookingId
          in: path
          description: M2X master booking id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  masterBookingId:
                    type: string
                    description: master booking id
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:masterBookings
  /masterBookings/{masterBookingId}/manifest:
    post:
      tags:
        - Master Bookings
      summary: Update a master booking's manifest
      parameters:
        - name: masterBookingId
          in: path
          description: Master BookingId Id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MasterBookingManifestRequest'
        description: Update master booking via manifest data
        required: true
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  masterBookingId:
                    type: string
                    description: master booking id
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - write:masterBookings
  /masterBookings/{masterBookingId}/expense:
    get:
      tags:
        - Master Bookings
      summary: Get a master booking expense view by id
      parameters:
        - name: masterBookingId
          in: path
          description: Internal M2X master booking id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MasterBookingExpenseResponse'
        '404':
          description: Corporate master booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:masterBookings
  /masterBookings/{masterBookingId}/revenue:
    get:
      tags:
        - Master Bookings
      summary: Get a master booking revenue view by id
      parameters:
        - name: masterBookingId
          in: path
          description: Internal M2X master booking id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MasterBookingRevenueResponse'
        '404':
          description: Corporate master booking not found
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - read:masterBookings
  /masterBookings:
    get:
      tags:
        - Master Bookings
      summary: Get a shipment's master bookings by shipment ID
      parameters:
        - name: shipmentId
          in: query
          description: Shipment Id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MasterBooking'
        '400':
          $ref: '#/components/responses/BadRequest'
      security:
        - M2X_auth_application:
            - read:masterBookings
  /transactions/{transactionId}/events:
    post:
      tags:
        - Transaction
      summary: Register an event for a transaction
      parameters:
        - name: transactionId
          in: path
          description: The transaction id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterTransactionEventRequest'
        description: The event to register
        required: true
      responses:
        '204':
          description: Successful operation
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - M2X_auth_application:
            - write:transactions
servers:
  - url: /apis/v0
  - url: https://m2x.app/apis/v0
    description: NZ Production server (uses live data)
  - url: https://us.m2x.app/apis/v0
    description: US Production server (uses live data)
  - url: https://au.m2x.app/apis/v0
    description: AUS Production server (uses live data)
  - url: https://staging.m2x.app/apis/v0
    description: Sandbox server
components:
  securitySchemes:
    M2X_auth_application:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /openId/token
          scopes:
            read:billingGroups: Read your billing groups
            write:billingGroups: Modify your billing groups
            read:bookings: Read your bookings info
            write:bookings: Modify your bookings info
            read:customers: Read your customers
            write:customers: Modify your customers
            read:customerBookings: Read your customer bookings info
            write:customerBookings: Modify your customer bookings info
            read:drivers: Read your drivers info
            write:drivers: Modify your drivers info
            read:fulfilment: Read your fulfilment request info
            write:fulfilment: Modify your fulfilment request info
            read:generalConsignments: Read your general consignments info
            write:generalConsignments: Modify your general consignments info
            read:isoContainers: Read your ISO containers info
            write:isoContainers: Modify your ISO containers info
            read:jobs: Read your jobs info
            write:jobs: Modify your jobs info
            read:largeContracts: Read your carrier large contracts info
            write:largeContracts: Modify your carrier large contracts info
            read:locations: Read your locations info
            write:locations: Modify your locations info
            read:masterBookings: Read your corporate container master bookings info
            write:masterBookings: Modify your corporate container master bookings info
            read:offers: Read your offers info
            write:offers: Modify your offers info
            read:orders: Read your carrier orders info
            write:orders: Modify your carrier orders info
            read:products: Read your products
            write:products: Modify your products
            read:subcontractors: Read your subcontractors info
            write:subcontractors: Modify your subcontractors info
            read:tasks: Read your tasks
            write:tasks: Modify your tasks
            read:tractorUnits: Read your tractor units info
            write:tractorUnits: Modify your tractor units info
            read:trailers: Read your trailers info
            write:trailers: Modify your trailers info
            write:transactions: Modify your transactions
            read:vehicles: Read your vehicles info
            write:vehicles: Modify your vehicles info
            write:vehicleLocations: Modify your vehicle locations
  responses:
    Success:
      description: Successful Operation
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: true
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: missing data
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: not found
    MasterBookingRequestBadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Invalid master booking request
              errors:
                oneOf:
                  - type: array
                    items:
                      type: string
                  - type: string
              code:
                type: string
    BulkTankDeliveryRequestBadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: The issue description
              code:
                type: string
                description: The code for the issue
                enum:
                  - CUSTOMER_NOT_FOUND
                  - INVALID_SCHEMA
                  - PRODUCT_NOT_FOUND
                  - TANK_NOT_FOUND
                  - INSUFFICIENT_TANK_CAPACITY
                  - LOCATION_NOT_FOUND
                  - INTERNAL_ERROR
    TanklessDeliveryRequestBadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                description: The issue description
              code:
                type: string
                description: The code for the issue
                enum:
                  - CUSTOMER_NOT_FOUND
                  - INVALID_SCHEMA
                  - PRODUCT_NOT_FOUND
                  - CONTENT_NOT_RESOLVED
                  - LOCATION_NOT_FOUND
                  - INTERNAL_ERROR
    DeliveryRequestNotFound:
      description: Could not find anything to read
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: deliveryRequest not found
    DeliveryRequestCannotDelete:
      description: Some deliveries have been dispatched for that request
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
              existingDeliveries:
                type: array
                items:
                  $ref: '#/components/schemas/FuelDeliveryActivity'
    DeliveryRequestCannotFindDelete:
      description: Could not find anything to delete
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
  schemas:
    CustomerRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          example: My customer
        externalId:
          type: string
          example: C123
          description: Rapid searchable id for front end users
        integrationId:
          type: string
          example: 123-123-123
          description: Customer Integration Id
        postalAddress:
          type: string
          example: 40 test street
          description: Address used to differentiate similar customers in the front end
        email:
          type: string
          example: email@test.com
        contactFirstName:
          type: string
          example: Joe
        contactLastName:
          type: string
          example: Blog
        businessPhone:
          type: string
          example: 000 000 00
        businessMobilePhone:
          type: string
          example: 000 000 00
        disabled:
          type: boolean
          description: Whether the customer is searchable in the front end
        onHold:
          type: boolean
    Customer:
      type: object
      properties:
        id:
          type: string
          example: customer123
        name:
          type: string
          example: My customer
        externalId:
          type:
            - string
            - 'null'
          example: C123
          description: Rapid searchable id for front end users
        integrationId:
          type: string
          example: 123-123-123
          description: Customer Integration Id
        postalAddress:
          type:
            - string
            - 'null'
          example: 40 test street
          description: Address used to differentiate similar customers in the front end
        email:
          type:
            - string
            - 'null'
          example: email@test.com
        contactFirstName:
          type:
            - string
            - 'null'
          example: Joe
        contactLastName:
          type:
            - string
            - 'null'
          example: Blog
        businessPhone:
          type:
            - string
            - 'null'
          example: 000 000 00
        businessMobilePhone:
          type:
            - string
            - 'null'
          example: 000 000 00
        disabled:
          type: boolean
          description: Whether the customer is searchable in the front end
        onHold:
          type: boolean
    Vehicle:
      allOf:
        - $ref: '#/components/schemas/VehicleRequest'
        - type: object
          required:
            - id
          properties:
            id:
              type: string
              example: L001
    VehicleRequestBase:
      type: object
      required:
        - vehicleId
        - disabled
        - type
      properties:
        vehicleId:
          type: string
          example: L001
          description: Human identifier for the vehicle
        disabled:
          type: boolean
          example: false
        registration:
          type:
            - string
            - 'null'
          example: ABC123
        externalId:
          type:
            - string
            - 'null'
          example: Human searchable external id
        tareWeightKg:
          type: number
          default: 0
        maxPayloadWeightKg:
          type: number
          default: 0
        heightMetres:
          type: number
          default: 0
        type:
          type: string
          enum:
            - Livestock
            - Bulk
            - Curtain Side
            - Tanker
            - Skeletal
            - Spreader
        properties:
          type: object
          additionalProperties: true
          description: >-
            A key value store containing bespoke properties usable for pricing
            and optimisation
          default: {}
        metadata:
          type: object
          additionalProperties: true
          description: Opaque passenger data
          default: {}
        updated:
          type: string
          format: date-time
        depotId:
          type:
            - string
            - 'null'
          example: fewa8fewhaea
          description: The depot id
        vin:
          type:
            - string
            - 'null'
          example: ABC123
          description: The VIN
        trackingProvider:
          type:
            - string
            - 'null'
          description: >-
            (optional) select which telematics to use (requires relevant
            telematics device id to be set)
          enum:
            - EROAD
            - MOTIVE
            - MTDATA
            - SAMSARA
            - ORBCOMM
            - MIX_TELEMATICS
            - NONE
          default: NONE
        eroadVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        motiveVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        mtDataVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        samsaraVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        orbcommVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        mixTelematicsVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        readonlyFields:
          type: object
          description: Specifies which field should not be touched by the user
          properties:
            vehicleId:
              type: boolean
              default: false
            registration:
              type: boolean
              default: false
            vin:
              type: boolean
              default: false
            type:
              type: boolean
              default: false
            tareWeightKg:
              deprecated: true
              type: boolean
              default: false
            maxPayloadWeightKg:
              deprecated: true
              type: boolean
              default: false
            heightMetres:
              deprecated: true
              type: boolean
              default: false
            weightClass:
              type: boolean
              default: false
            base:
              type: boolean
              default: false
            externalId:
              type: boolean
              default: false
            telematics:
              type: boolean
              default: false
            compartments:
              type: boolean
              default: false
    BulkVehicle:
      type: object
      allOf:
        - $ref: '#/components/schemas/VehicleRequestBase'
        - type: object
          properties:
            physicalConfiguration:
              $ref: '#/components/schemas/BulkPhysicalConfiguration'
    LivestockVehicle:
      type: object
      allOf:
        - $ref: '#/components/schemas/VehicleRequestBase'
        - type: object
          properties:
            physicalConfiguration:
              $ref: '#/components/schemas/LivestockPhysicalConfiguration'
    SkeletalVehicle:
      type: object
      allOf:
        - $ref: '#/components/schemas/VehicleRequestBase'
        - type: object
          properties:
            physicalConfiguration:
              $ref: '#/components/schemas/SkeletalPhysicalConfiguration'
    VehicleRequest:
      type: object
      oneOf:
        - $ref: '#/components/schemas/SkeletalVehicle'
        - $ref: '#/components/schemas/LivestockVehicle'
        - $ref: '#/components/schemas/BulkVehicle'
      discriminator:
        propertyName: type
        mapping:
          Bulk: '#/components/schemas/BulkVehicle'
          Curtain Side: '#/components/schemas/BulkVehicle'
          Tanker: '#/components/schemas/BulkVehicle'
          Spreader: '#/components/schemas/BulkVehicle'
          Livestock: '#/components/schemas/LivestockVehicle'
          Skeletal: '#/components/schemas/SkeletalVehicle'
    BasePhysicalConfiguration:
      type: object
      required:
        - maxPayloadWeightKg
        - tareWeightKg
      properties:
        heightMetres:
          type: number
          example: 2.1
          description: The height of the vehicle
        tareWeightKg:
          type: number
          example: 1000
          description: The tare weight of the vehicle
        maxPayloadWeightKg:
          type: number
          example: 30000
          description: The max payload weight of the vehicle
    BulkPhysicalConfiguration:
      allOf:
        - $ref: '#/components/schemas/BasePhysicalConfiguration'
        - $ref: '#/components/schemas/AxleLoading'
        - type: object
          properties:
            compartments:
              type: array
              items:
                type: object
                required:
                  - compartmentId
                  - name
                  - volumeM3
                properties:
                  compartmentId:
                    type: string
                    example: asd123
                    description: Globally unique compartment id
                  name:
                    type: string
                    example: 1
                    description: Human friendly name if the compartment
                  volumeM3:
                    type: number
                    example: 4
                    description: >-
                      The volume in cubic meter of the compartment (non
                      livestock and skeletal)
                  offset:
                    type: number
                    example: 1000
                    description: >-
                      The offset in mm of the center of the compartment relative
                      to the front axle or kingpin
    LivestockPhysicalConfiguration:
      allOf:
        - $ref: '#/components/schemas/BasePhysicalConfiguration'
        - type: object
          properties:
            compartments:
              type: array
              items:
                type: object
                required:
                  - compartmentId
                  - name
                  - areaM2
                properties:
                  compartmentId:
                    type: string
                    example: asd123
                    description: Globally unique compartment id
                  name:
                    type: string
                    example: 1
                    description: Human friendly name if the compartment
                  areaM2:
                    type: number
                    example: 4
                    description: The area in square meter of the compartment
                  additionalFloorCount:
                    type: number
                    example: 1
                    description: The number of sheep/pig decks available
                  heightMetres:
                    type: number
                    example: 4
                    description: The height of the pen
                  position:
                    type: array
                    minItems: 2
                    maxItems: 2
                    example:
                      - 0
                      - 0
                    items:
                      type: integer
    DollyPhysicalConfiguration:
      allOf:
        - $ref: '#/components/schemas/BasePhysicalConfiguration'
        - $ref: '#/components/schemas/AxleLoading'
    FlatDeckPhysicalConfiguration:
      allOf:
        - $ref: '#/components/schemas/BasePhysicalConfiguration'
        - type: object
          properties:
            compartments:
              type: array
              items:
                type: object
                required:
                  - compartmentId
                  - name
                  - lengthM
                  - volumeM3
                properties:
                  compartmentId:
                    type: string
                    example: asd123
                    description: Globally unique compartment id
                  name:
                    type: string
                    example: 1
                    description: Human friendly name if the compartment
                  lengthM:
                    type: number
                    example: 4
                    description: The length in meter of the compartment
                  volumeM3:
                    type: number
                    example: 4
                    description: >-
                      The volume in cubic meter of the compartment (non
                      livestock and skeletal)
    SkeletalPhysicalConfiguration:
      allOf:
        - $ref: '#/components/schemas/BasePhysicalConfiguration'
        - type: object
          properties:
            compartments:
              type: array
              items:
                type: object
                required:
                  - compartmentId
                  - name
                  - lengthM
                properties:
                  compartmentId:
                    type: string
                    example: asd123
                    description: Globally unique compartment id
                  name:
                    type: string
                    example: 1
                    description: Human friendly name if the compartment
                  lengthM:
                    type: number
                    example: 4
                    description: The length in meter of the compartment
    VehicleLocation:
      type: object
      required:
        - accuracy
        - latitude
        - longitude
        - timestamp
      properties:
        accuracy:
          type: integer
          format: int32
          description: Location accuracy in meters
        latitude:
          type: integer
          format: int32
          description: Location latitude (WGS 84)
        longitude:
          type: integer
          format: int32
          description: Location longitude (WGS 84)
        deviceId:
          type: string
          description: >-
            Unique identifier for the tracking device (important when several
            tracking devices are active on the vehicle)
        heading:
          type: integer
          format: int32
          description: Heading from north (0,360)
        timestamp:
          oneOf:
            - type: integer
              format: int64
              description: Epoch timestamp (seconds since 1970) of the location capture
            - type: string
              format: date-time
              description: RFC3339 time of the location capture
        speed:
          type: integer
          format: int32
          description: Speed in kph
        altitude:
          type: integer
          format: int32
          description: Altitude in meters
        vehicleId:
          type: string
        locationName:
          type:
            - string
            - 'null'
    TractorUnit:
      allOf:
        - $ref: '#/components/schemas/TractorUnitRequest'
        - type: object
          properties:
            id:
              type: string
              example: T001
    TractorUnitRequest:
      type: object
      required:
        - name
        - disabled
      properties:
        name:
          type: string
          example: T001
          description: Human identifier for the tractor unit
        disabled:
          type: boolean
          example: false
        registration:
          type: string
          example: ABC123
        description:
          type: string
          example: unit 6
        vin:
          type: string
          example: VIN123
        externalId:
          type: string
          example: Human searchable external id
        physicalConfiguration:
          type: object
          properties:
            heightMetres:
              type: number
              example: 2.1
              description: The height of the tractor unit
            tareWeightKg:
              type: number
              example: 20000
              description: The tare weight of the tractor unit
        properties:
          type: object
          additionalProperties: true
          description: >-
            A key value store containing bespoke properties usable for pricing
            and optimisation
          default: {}
        metadata:
          type: object
          additionalProperties: true
          description: Opaque passenger data
          default: {}
        trackingProvider:
          type:
            - string
            - 'null'
          description: >-
            (optional) select which telematics to use (requires relevant
            telematics device id to be set)
          enum:
            - EROAD
            - MOTIVE
            - MTDATA
            - SAMSARA
            - ORBCOMM
            - MIX_TELEMATICS
            - NONE
          default: NONE
        eroadVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        motiveVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        mtDataVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        samsaraVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        orbcommVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        mixTelematicsVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        readonlyFields:
          type: object
          description: Specifies which field should not be touched by the user
          properties:
            name:
              type: boolean
              default: false
            registration:
              type: boolean
              default: false
            vin:
              type: boolean
              default: false
            tareWeightKg:
              type: boolean
              default: false
            heightMetres:
              type: boolean
              default: false
            description:
              type: boolean
              default: false
            externalId:
              type: boolean
              default: false
            telematics:
              type: boolean
              default: false
        updated:
          type: string
          format: date-time
    Trailer:
      allOf:
        - $ref: '#/components/schemas/TrailerRequest'
        - type: object
          properties:
            id:
              type: string
              example: T001
    AxleLoading:
      type: object
      properties:
        axleLoadingConfig:
          type:
            - boolean
            - 'null'
          default: null
          description: Enables the axle loading config on the vehicle/trailer
        frontAxle:
          type:
            - boolean
            - 'null'
          default: null
          description: >-
            Enables the front axle on the vehicle component. This is false for a
            semi-trailer
        distanceFromFrontAxle:
          type:
            - number
            - 'null'
          description: >-
            Distance in mm from the front axle to the fifth wheel. This is only
            used for Shared Axle components.
          example: 7800
          default: null
        frontAxleMaxLoadKg:
          type:
            - number
            - 'null'
          description: Max kg load on front axle
          example: 6000
          default: null
        frontTareKg:
          type: number
          description: Tare weight in kg on the front axle
          example: 4000
          default: 0
        rearAxleMaxLoadKg:
          type: number
          description: Max kg load on rear axle
          example: 18000
          default: 0
        rearConnection:
          type: string
          description: The mode of connection in the rear to any possible trailers
          default: None
          enum:
            - Shared Axle
            - Drawbar
            - None
        rearTareKg:
          type: number
          description: Tare weight in kg on the rear axle
          example: 6000
          default: 0
        wheelbase:
          type: number
          description: >-
            Distance in mm between front and rear axle group, or between kingpin
            and rear axle group if a semi trailer
          example: 8000
          default: 0
    TrailerRequestBase:
      type: object
      required:
        - name
        - disabled
        - type
      properties:
        name:
          type: string
          example: T001
          description: Human identifier for the trailer
        disabled:
          type: boolean
          example: false
        registration:
          type:
            - string
            - 'null'
          example: ABC123
        description:
          type:
            - string
            - 'null'
          example: Dog Trailer
        externalId:
          type:
            - string
            - 'null'
          example: Human searchable external id
        tareWeightKg:
          deprecated: true
          type: number
          default: 0
        maxPayloadWeightKg:
          deprecated: true
          type: number
          default: 0
        heightMetres:
          deprecated: true
          type: number
          default: 0
        type:
          type: string
          enum:
            - Livestock
            - Bulk
            - Curtain Side
            - Dolly
            - Tanker
            - Skeletal
            - Flat Deck
            - Spreader
        properties:
          type: object
          additionalProperties: true
          description: >-
            A key value store containing bespoke properties usable for pricing
            and optimisation
          default: {}
        metadata:
          type: object
          additionalProperties: true
          description: Opaque passenger data
          default: {}
        trackingProvider:
          type:
            - string
            - 'null'
          description: >-
            (optional) select which telematics to use (requires relevant
            telematics device id to be set)
          enum:
            - EROAD
            - MOTIVE
            - MTDATA
            - SAMSARA
            - ORBCOMM
            - MIX_TELEMATICS
            - NONE
          default: NONE
        eroadVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        motiveVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        mtDataVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        samsaraVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        orbcommVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        mixTelematicsVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        labels:
          type: array
          default: []
          description: >-
            (optional) an array of labels use to generate the vehicle groups for
            routing template selection
          items:
            type: string
        readonlyFields:
          type: object
          description: Specifies which field should not be touched by the user
          properties:
            name:
              type: boolean
              default: false
            labels:
              type: boolean
              default: false
            registration:
              type: boolean
              default: false
            type:
              type: boolean
              default: false
            tareWeightKg:
              type: boolean
              default: false
            maxPayloadWeightKg:
              type: boolean
              default: false
            heightMetres:
              type: boolean
              default: false
            description:
              type: boolean
              default: false
            externalId:
              type: boolean
              default: false
            telematics:
              type: boolean
              default: false
            axleLoadingConfig:
              type: boolean
              default: false
            compartments:
              type: boolean
              default: false
    BulkTrailer:
      type: object
      allOf:
        - $ref: '#/components/schemas/TrailerRequestBase'
        - type: object
          properties:
            physicalConfiguration:
              $ref: '#/components/schemas/BulkPhysicalConfiguration'
    LivestockTrailer:
      type: object
      allOf:
        - $ref: '#/components/schemas/TrailerRequestBase'
        - type: object
          properties:
            physicalConfiguration:
              allOf:
                - $ref: '#/components/schemas/LivestockPhysicalConfiguration'
                - $ref: '#/components/schemas/AxleLoading'
    SkeletalTrailer:
      type: object
      allOf:
        - $ref: '#/components/schemas/TrailerRequestBase'
        - type: object
          properties:
            physicalConfiguration:
              allOf:
                - $ref: '#/components/schemas/SkeletalPhysicalConfiguration'
                - $ref: '#/components/schemas/AxleLoading'
    FlatDeckTrailer:
      type: object
      allOf:
        - $ref: '#/components/schemas/TrailerRequestBase'
        - type: object
          properties:
            physicalConfiguration:
              allOf:
                - $ref: '#/components/schemas/FlatDeckPhysicalConfiguration'
                - $ref: '#/components/schemas/AxleLoading'
    DollyTrailer:
      type: object
      allOf:
        - $ref: '#/components/schemas/TrailerRequestBase'
        - type: object
          properties:
            physicalConfiguration:
              $ref: '#/components/schemas/DollyPhysicalConfiguration'
    TrailerRequest:
      type: object
      oneOf:
        - $ref: '#/components/schemas/SkeletalTrailer'
        - $ref: '#/components/schemas/LivestockTrailer'
        - $ref: '#/components/schemas/BulkTrailer'
        - $ref: '#/components/schemas/DollyTrailer'
        - $ref: '#/components/schemas/FlatDeckTrailer'
      discriminator:
        propertyName: type
        mapping:
          Bulk: '#/components/schemas/BulkTrailer'
          Curtain Side: '#/components/schemas/BulkTrailer'
          Dolly: '#/components/schemas/DollyTrailer'
          Tanker: '#/components/schemas/BulkTrailer'
          Spreader: '#/components/schemas/BulkTrailer'
          Livestock: '#/components/schemas/LivestockTrailer'
          Skeletal: '#/components/schemas/SkeletalTrailer'
          Flat Deck: '#/components/schemas/FlatDeckTrailer'
    IsoContainer:
      allOf:
        - $ref: '#/components/schemas/IsoContainerRequest'
        - type: object
          properties:
            id:
              type: string
              example: C001
    IsoContainerRequestBase:
      type: object
      required:
        - name
        - disabled
        - type
      properties:
        name:
          type: string
          example: ISO1
          description: Human identifier for the trailer
        type:
          type: string
          enum:
            - Dry
            - Reefer
            - Tank
        disabled:
          type: boolean
          example: false
        description:
          type:
            - string
            - 'null'
          example: Green Container
        externalId:
          type:
            - string
            - 'null'
          example: Human searchable external id
        tareWeightKg:
          type: number
          default: 0
          deprecated: true
        maxPayloadWeightKg:
          deprecated: true
          type: number
          default: 0
        heightMetres:
          deprecated: true
          type: number
          default: 0
        length:
          type: number
          enum:
            - 6.058
            - 12.192
            - 13.716
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        trackingProvider:
          type:
            - string
            - 'null'
          description: >-
            (optional) select which telematics to use (requires relevant
            telematics device id to be set)
          enum:
            - EROAD
            - MOTIVE
            - MTDATA
            - SAMSARA
            - ORBCOMM
            - MIX_TELEMATICS
            - NONE
          default: NONE
        eroadVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        motiveVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        mtDataVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        samsaraVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        orbcommVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        mixTelematicsVehicleId:
          type:
            - string
            - 'null'
          description: (optional) telematics device id
          default: null
        readonlyFields:
          type: object
          description: Specifies which field should not be touched by the user
          properties:
            name:
              type: boolean
              default: false
            groups:
              type: boolean
              default: false
            type:
              type: boolean
              default: false
            length:
              type: boolean
              default: false
            tareWeightKg:
              type: boolean
              default: false
            maxPayloadWeightKg:
              type: boolean
              default: false
            heightMetres:
              type: boolean
              default: false
            description:
              type: boolean
              default: false
            externalId:
              type: boolean
              default: false
            telematics:
              type: boolean
              default: false
            compartments:
              type: boolean
              default: false
    BulkIsoContainer:
      type: object
      allOf:
        - $ref: '#/components/schemas/IsoContainerRequestBase'
        - type: object
          properties:
            physicalConfiguration:
              $ref: '#/components/schemas/BulkPhysicalConfiguration'
    IsoContainerRequest:
      type: object
      oneOf:
        - $ref: '#/components/schemas/BulkIsoContainer'
      discriminator:
        propertyName: type
        mapping:
          Dry: '#/components/schemas/BulkIsoContainer'
          Reefer: '#/components/schemas/BulkIsoContainer'
          Tank: '#/components/schemas/BulkIsoContainer'
    Driver:
      allOf:
        - $ref: '#/components/schemas/DriverRequest'
        - type: object
          properties:
            id:
              type: string
              example: D001
    DriverRequest:
      type: object
      required:
        - name
        - disabled
      properties:
        name:
          type: string
          example: John
          description: Driver name
        disabled:
          type: boolean
          example: false
        mobile:
          type: string
          example: +33 123
          description: Driver phone number
        description:
          type: string
          example: Nice Guy
        externalId:
          type: string
          example: Human searchable external id
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        readonlyFields:
          type: object
          description: Specifies which field should not be touched by the user
          properties:
            name:
              type: boolean
              default: false
            mobile:
              type: boolean
              default: false
            description:
              type: boolean
              default: false
            externalId:
              type: boolean
              default: false
    Subcontractor:
      allOf:
        - $ref: '#/components/schemas/SubcontractorRequest'
        - type: object
          properties:
            id:
              type: string
              example: D001
    SubcontractorRequest:
      type: object
      required:
        - subcontractorName
        - disabled
      properties:
        subcontractorName:
          type: string
          example: John
          description: Subcontractor name
        disabled:
          type: boolean
          example: false
        carrierId:
          type: string
          example: C001
          description: Carrier id of the subcontractor
        carrierName:
          type: string
          example: Nice Subcontractor
          description: Carrier name of the subcontractor
        customerId:
          type: string
          example: C001
          description: Customer id of the subcontractor
        email:
          type: string
          example: my@subcontractor.com
        externalId:
          type: string
          example: Human searchable external id
        subcontractorId:
          type: string
          example: C001
        vehicleExternalId:
          type: string
          example: EXT001
          description: External id of the subcontractor vehicle when dispatching
        vehicleId:
          type: string
          example: V001
          description: Id of the subcontractor vehicle when dispatching
        vehicleName:
          type: string
          example: Nice Subcontractor Vehicle
          description: Name of the subcontractor vehicle when dispatching
        properties:
          $ref: '#/components/schemas/CustomProperties'
        readonlyFields:
          type: object
          description: Specifies which field should not be touched by the user
          properties:
            subcontractorName:
              type: boolean
              default: false
            email:
              type: boolean
              default: false
            vehicleExternalId:
              type: boolean
              default: false
            vehicleId:
              type: boolean
              default: false
            vehicleName:
              type: boolean
              default: false
            externalId:
              type: boolean
              default: false
            properties:
              type: boolean
              default: false
    Depot:
      type: object
      properties:
        name:
          example: A test depot
          type: string
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
        location:
          $ref: '#/components/schemas/Location'
        deleted:
          type: boolean
          example: false
        published:
          type: boolean
          example: false
    Storage:
      type: object
      required:
        - locationId
      properties:
        locationId:
          type: string
          description: locationId to this storage
          example: v9He21dFSZOmkrRaQbzD
        disabled:
          type: boolean
          example: false
        productCodeId:
          type: string
          description: Product for the storage
        capacityLitres:
          type: number
        capacityFuelMinPumpableLitres:
          type: number
        capacityFuelSafeFillLitres:
          type: number
        capacityFuelSafetyStockLitres:
          type: number
        name:
          example: A test
          type: string
    GeometryRegion:
      type: object
      required:
        - id
        - disabled
        - name
        - regionGeometryGeoJson
        - updated
        - created
      properties:
        id:
          type: string
          description: the unique geometry region identifier
        disabled:
          type: boolean
        name:
          type: string
          description: the name of the geometry region
        externalId:
          type:
            - string
            - 'null'
          description: a short human id for the region
        regionGeometryGeoJson:
          type: string
          description: the geojson representation of the geometry
        created:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
    JobLocation:
      allOf:
        - $ref: '#/components/schemas/JobLocationRequest'
        - type: object
          properties:
            id:
              type: string
              example: D001
            updated:
              type:
                - string
                - 'null'
              format: date-time
    JobLocationRequest:
      type: object
      required:
        - shortName
        - disabled
      properties:
        locationKind:
          type:
            - string
            - 'null'
          enum:
            - Farm
            - Carrier
            - Port
            - Warehouse
            - Sale Yard
            - Holding Yard
            - Works
            - Weighbridge
            - Accommodation
            - Quarry
            - Mine
            - Store
            - Plant
            - Forest
            - Ranch
            - Growyard
            - Elevator
            - Feedyard
            - Depot
            - Pack Site
            - Container Depot
        shortName:
          type: string
          example: Dreamy Farm
        areaName:
          type:
            - string
            - 'null'
          example: Mystery Creek
        facilityName:
          type:
            - string
            - 'null'
          example: Main Yards
        addressText:
          type:
            - string
            - 'null'
          example: Main Yards
        latitude:
          type:
            - number
            - 'null'
          description: >-
            If null or not provided, the latitude from the current location will
            be retained.  If there is no current latitude, it will be resolved
            by geocoding.
        longitude:
          type:
            - number
            - 'null'
          description: >-
            If null or not provided, the longitude from the current location
            will be retained.  If there is no current longitude, it will be
            resolved by geocoding.
        externalId:
          type:
            - string
            - 'null'
          description: >-
            An optional external identifier assigned to the location. This ID
            can be provided when creating the location and is typically used for
            cross-system referencing or integration with external data sources.
        inboundIntegrationIds:
          type:
            - array
            - 'null'
          items:
            type: string
        disabled:
          type: boolean
          example: false
        onHold:
          type: boolean
          example: false
        customer:
          type:
            - object
            - 'null'
          description: At least one field needs to be provided to resolve the customer
          default: null
          properties:
            customerId:
              type: string
              description: M2X customer ID
            customerName:
              type: string
              description: Customer name
            integrationId:
              type: string
              description: Customer integration ID
            externalId:
              type: string
              description: External customer ID
        mobile:
          type:
            - string
            - 'null'
          example: +33 123
          description: Location mobile number
        phone:
          type:
            - string
            - 'null'
          example: +33 123
          description: Location phone number
        email:
          type:
            - string
            - 'null'
          example: asd@asd.asd
          description: Location email
        hazards:
          type:
            - string
            - 'null'
          description: Hazards descriptions
        notes:
          type:
            - string
            - 'null'
          description: Notes
        properties:
          $ref: '#/components/schemas/CustomProperties'
        requirements:
          $ref: '#/components/schemas/CustomProperties'
        restrictions:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        readonlyFields:
          type:
            - object
            - 'null'
          description: Specifies which field should not be touched by the user
          properties:
            disabled:
              type: boolean
              default: false
            latitude:
              type: boolean
              default: false
            longitude:
              type: boolean
              default: false
            notes:
              type: boolean
              default: false
            hazards:
              type: boolean
              default: false
            shortName:
              type: boolean
              default: false
            externalId:
              type: boolean
              default: false
            inboundIntegrationIds:
              type: boolean
              default: false
            areaName:
              type: boolean
              default: false
            facilityName:
              type: boolean
              default: false
            locationKind:
              type: boolean
              default: false
            customer:
              type: boolean
              default: false
            mobile:
              type: boolean
              default: false
            phone:
              type: boolean
              default: false
            email:
              type: boolean
              default: false
            onHold:
              type: boolean
              default: false
            gtnCaptureRequiredPickup:
              type: boolean
              default: false
            gtnCaptureRequiredDelivery:
              type: boolean
              default: false
            openingHours:
              type: boolean
              default: false
        accessLatitude:
          type:
            - number
            - 'null'
          default: null
        accessLongitude:
          type:
            - number
            - 'null'
          default: null
        maxIncomingWeight:
          type:
            - number
            - 'null'
          default: null
        maxOutgoingWeight:
          type:
            - number
            - 'null'
          default: null
        minIncomingWeight:
          type:
            - number
            - 'null'
          default: null
        minOutgoingWeight:
          type:
            - number
            - 'null'
          default: null
        offRoadDistance:
          type:
            - number
            - 'null'
          default: null
        offRoadDuration:
          type:
            - number
            - 'null'
          default: null
        waitTime:
          type:
            - number
            - 'null'
          default: null
        contactName:
          type:
            - string
            - 'null'
          default: null
        contactNotes:
          type:
            - string
            - 'null'
          default: null
        dairySupplyGeneration:
          type:
            - object
            - 'null'
          default: null
        geofenceType:
          type:
            - string
            - 'null'
          enum:
            - Circular
            - Polygon
            - null
          default: null
        polygonGeofence:
          type:
            - string
            - 'null'
          example: >-
            POLYGON ((-105.0105 39.7617,-105.0108 39.7614,-105.0111
            39.7616,-105.0105 39.7617))
          description: >-
            If geofenceType is "Polygon" uses this WKT closed polygon (last and
            first lat/long pair must match)
          default: null
        radius:
          type:
            - integer
            - 'null'
          example: 300
          default: null
          description: >-
            If geofenceType is "Circular" uses this integer radius in meters
            around the determined or provided lat/long
        geofenceAlerting:
          type:
            - object
            - 'null'
          default: null
          required:
            - enabled
          properties:
            enabled:
              type: boolean
            emails:
              type:
                - array
                - 'null'
              description: A list of email addresses
              items:
                type: string
                example: abc@example.com
            mobileNumbers:
              type:
                - array
                - 'null'
              description: A list of mobile numbers
              items:
                type: string
                example: 64211234567
        gtnCaptureRequiredPickup:
          type:
            - string
            - 'null'
          description: Policy for weighbridge input on pickup
          enum:
            - MANDATORY
            - OPTIONAL
            - NONE
            - null
          default: null
        gtnCaptureRequiredDelivery:
          type:
            - string
            - 'null'
          description: Policy for weighbridge input on delivery
          enum:
            - MANDATORY
            - OPTIONAL
            - NONE
            - null
          default: null
        openingHours:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/LocationOpeningHours'
        weeklySupplyGeneration:
          type:
            - object
            - 'null'
          properties:
            enabled:
              type: boolean
            interactionsInstructions:
              type:
                - array
                - 'null'
              items:
                type: object
                required:
                  - storageId
                properties:
                  storageId:
                    type: string
                  storageName:
                    type:
                      - string
                      - 'null'
                  onHold:
                    type: boolean
                  capacity:
                    type: object
                    properties:
                      capacityFuelMinPumpableLitres:
                        type:
                          - number
                          - 'null'
                      capacityFuelSafeFillLitres:
                        type:
                          - number
                          - 'null'
                      capacityFuelSafetyStockLitres:
                        type:
                          - number
                          - 'null'
                      capacityLitres:
                        type:
                          - number
                          - 'null'
                  product:
                    type: object
                    required:
                      - productCodeId
                      - productCodeName
                      - productId
                    properties:
                      productCodeId:
                        type: string
                      productCodeName:
                        type: string
                      productId:
                        type: string
                      productLinearRate:
                        type:
                          - number
                          - 'null'
                  productLinearRateCalculated:
                    type: boolean
            defaultProductEnabled:
              type: boolean
            dayCollectionWindow:
              type:
                - object
                - 'null'
              properties:
                startTime:
                  type:
                    - string
                    - 'null'
                  description: >-
                    The start of the collection/delivery time window.  May
                    extend past 24:00 for overnight time windows.
                  example: '07:00'
                endTime:
                  type:
                    - string
                    - 'null'
                  description: >-
                    The end of the collection/delivery time window.  May extend
                    past 24:00 for overnight time windows.
                  example: '28:00'
            generationBasis:
              type:
                - string
                - 'null'
              enum:
                - PATTERN
                - SAFETY_STOCK
            patternType:
              type:
                - string
                - 'null'
              enum:
                - TWICE_WEEKLY
                - WEEKLY
                - FORTNIGHTLY
                - THIRD_WEEK
                - FOURTH_WEEK
                - FIVE_DAYS
                - CUSTOM
            pattern:
              type:
                - array
                - 'null'
              items:
                type: object
                required:
                  - monday
                  - tuesday
                  - wednesday
                  - thursday
                  - friday
                  - saturday
                  - sunday
                properties:
                  monday:
                    $ref: '#/components/schemas/SupplyGenerationPatternDay'
                  tuesday:
                    $ref: '#/components/schemas/SupplyGenerationPatternDay'
                  wednesday:
                    $ref: '#/components/schemas/SupplyGenerationPatternDay'
                  thursday:
                    $ref: '#/components/schemas/SupplyGenerationPatternDay'
                  friday:
                    $ref: '#/components/schemas/SupplyGenerationPatternDay'
                  saturday:
                    $ref: '#/components/schemas/SupplyGenerationPatternDay'
                  sunday:
                    $ref: '#/components/schemas/SupplyGenerationPatternDay'
            patternStartDay:
              type:
                - string
                - 'null'
              description: YYYY-MM-DD
              example: '2024-01-01'
              format: date
            customPriority:
              type:
                - string
                - 'null'
              enum:
                - HIGH
                - MEDIUM
                - LOW
            isTopupSite:
              type: boolean
            product:
              type:
                - object
                - 'null'
              properties:
                productCodeName:
                  type:
                    - string
                    - 'null'
                productCodeId:
                  type:
                    - string
                    - 'null'
                productId:
                  type:
                    - string
                    - 'null'
                productBundle:
                  type:
                    - object
                    - 'null'
                  properties:
                    payload:
                      type: array
                      items:
                        required:
                          - productCode
                          - quantity
                        properties:
                          productCode:
                            type: object
                            required:
                              - productCodeId
                            properties:
                              productCodeId:
                                type: string
                              productCodeName:
                                type: string
                              productId:
                                type: string
                          proportion:
                            type:
                              - number
                              - 'null'
                          quantity:
                            type: number
                          description:
                            type:
                              - string
                              - 'null'
                          itemId:
                            type:
                              - string
                              - 'null'
                          productLinearRate:
                            type:
                              - number
                              - 'null'
            productQuantity:
              type:
                - number
                - 'null'
    LocationOpeningHours:
      type: object
      properties:
        mon:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/OpenHours'
        tue:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/OpenHours'
        wed:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/OpenHours'
        thu:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/OpenHours'
        fri:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/OpenHours'
        sat:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/OpenHours'
        sun:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/OpenHours'
      example:
        mon:
          type: open
        tue:
          type: restricted
          open: '09:00'
          close: '17:00'
        wed:
          type: restricted
          open: '09:00'
          close: '17:00'
        thu:
          type: restricted
          open: '09:00'
          close: '17:00'
        fri:
          type: restricted
          open: '09:00'
          close: '17:00'
        sat:
          type: restricted
          open: '10:00'
          close: '15:00'
        sun:
          type: closed
    OpenHours:
      oneOf:
        - $ref: '#/components/schemas/OpenAllDay'
        - $ref: '#/components/schemas/RestrictedDuration'
        - $ref: '#/components/schemas/ClosedAllDay'
    OpenAllDay:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - open
      additionalProperties: false
    RestrictedDuration:
      type: object
      required:
        - type
        - open
        - close
      properties:
        type:
          type: string
          enum:
            - restricted
        open:
          type: string
          pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$|^24:00$
          example: '01:00'
          description: Opening time in HH:MM format (24-hour)
        close:
          type: string
          pattern: ^([0-1][0-9]|2[0-3]):[0-5][0-9]$|^24:00$
          example: '22:00'
          description: Closing time in HH:MM format (24-hour)
      additionalProperties: false
    ClosedAllDay:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - closed
      additionalProperties: false
    SupplyGenerationPatternDay:
      type: object
      properties:
        day:
          type: boolean
        night:
          type: boolean
    LocationGroupUpsertRequest:
      type: object
      required:
        - integrationId
        - name
      properties:
        name:
          type: string
        saveIfUnknown:
          type: boolean
          default: false
        integrationId:
          type: string
        code:
          type: string
        type:
          type: string
          default: Supplier
          enum:
            - Supplier
            - Buyer
        agentsIntegrationIds:
          type: array
          items:
            type: string
        locationPoolsIntegrationIds:
          type: array
          items:
            type: string
    FuelStorage:
      type: object
      properties:
        id:
          type: string
          example: D001
        capacityFuelMinPumpableLitres:
          type: number
        capacityFuelSafeFillLitres:
          type: number
        capacityFuelSafetyStockLitres:
          type: number
        capacityLitres:
          type: number
        disabled:
          type: boolean
        locationId:
          type: string
          example: D001
        integrationId:
          type: string
          example: D001
        onHold:
          type: boolean
          example: false
        name:
          type: string
          example: D001
        productCodeId:
          type: string
          example: D001
        productCodeName:
          type: string
          example: D001
    FuelStorageRequest:
      type: object
      properties:
        capacityFuelMinPumpableLitres:
          type: number
        capacityFuelSafeFillLitres:
          type: number
        capacityFuelSafetyStockLitres:
          type: number
        capacityLitres:
          type: number
        disabled:
          type: boolean
        integrationId:
          type: string
          example: D001
        onHold:
          type: boolean
          example: false
        name:
          type: string
          example: D001
        product:
          $ref: '#/components/schemas/CarrierProductMappingRequest'
        readonlyFields:
          type:
            - object
            - 'null'
          description: Specifies which field should not be touched by the user
          properties:
            capacityFuelMinPumpableLitres:
              type: boolean
              default: false
            capacityFuelSafeFillLitres:
              type: boolean
              default: false
            capacityFuelSafetyStockLitres:
              type: boolean
              default: false
            capacityLitres:
              type: boolean
              default: false
            onHold:
              type: boolean
              default: false
            disabled:
              type: boolean
              default: false
            integrationId:
              type: boolean
              default: false
            name:
              type: boolean
              default: false
            product:
              type: boolean
              default: false
    FuelStorageMeasurementRequest:
      type: object
      properties:
        type:
          type: string
          enum:
            - STANDARD_DIP
            - PRE_DIP
            - POST_DIP
          default: STANDARD_DIP
        timestamp:
          type: string
          format: date-time
          description: RFC3339 date time of the measurement
        quantityLitres:
          type: number
    FuelInventoryAdjustmentActivity:
      type: object
      properties:
        id:
          type: string
          example: D001
        constraintId:
          type:
            - string
            - 'null'
          example: D001
        dispatchGroupId:
          type:
            - string
            - 'null'
          example: ABC1123-asdasdasd-123213
        deleted:
          type: boolean
        vehicleId:
          type: string
          example: D001
        vehicleExternalId:
          type:
            - string
            - 'null'
        driver:
          anyOf:
            - $ref: '#/components/schemas/FuelDriver'
            - type: 'null'
        shiftMetadata:
          $ref: '#/components/schemas/ShiftMetadata'
        reasonCode:
          anyOf:
            - type: object
              properties:
                label:
                  type: string
                code:
                  type: string
                reasonCodeId:
                  type: string
            - type: 'null'
        timestamp:
          type:
            - string
            - 'null'
          format: date-time
        actual:
          type: object
          properties:
            vehicleId:
              type: string
              example: D001
            truckReference:
              type: string
              example: D001
            timestamp:
              type:
                - string
                - 'null'
              format: date-time
            inboundInventory:
              type:
                - object
                - 'null'
              properties:
                compartments:
                  type: array
                  items:
                    $ref: '#/components/schemas/FuelCompartmentLoadout'
            outboundInventory:
              type:
                - object
                - 'null'
              properties:
                compartments:
                  type: array
                  items:
                    $ref: '#/components/schemas/FuelCompartmentLoadout'
            inboundProducts:
              type: array
              items:
                $ref: '#/components/schemas/DynamicFulfilmentProduct'
            outboundProducts:
              type: array
              items:
                $ref: '#/components/schemas/DynamicFulfilmentProduct'
            odometerDistanceKm:
              type:
                - number
                - 'null'
              description: The odometer distance reading in kilometers
    FuelInteractionTransaction:
      type: object
      properties:
        reasonCode:
          type:
            - object
            - 'null'
          default: null
          properties:
            label:
              type: string
            code:
              type: string
        storageId:
          type: string
          description: The storage being interacted with
        storageIntegrationId:
          type:
            - string
            - 'null'
          description: The external identifier of the storage
        sources:
          type: array
          items:
            type: object
            properties:
              compartmentId:
                type:
                  - string
                  - 'null'
              empty:
                type: boolean
              quantity:
                type: number
    FuelStorageMeasurements:
      type: object
      properties:
        storageId:
          type:
            - string
            - 'null'
          default: null
        storageIntegrationId:
          type:
            - string
            - 'null'
          description: The external identifier of the storage
        preDipLitre:
          type:
            - number
            - 'null'
          description: The pre delivery dip measurement
        postDipLitre:
          type:
            - number
            - 'null'
          description: The post delivery dip measurement
        isBespokeTank:
          type: boolean
          description: whether the tank was added on the fly by the driver
    FuelCompartmentLoadout:
      type: object
      properties:
        compartmentId:
          type: string
        products:
          type: array
          items:
            $ref: '#/components/schemas/DynamicFulfilmentProduct'
    FuelDeliveryActivity:
      type: object
      properties:
        id:
          type: string
          example: D001
        constraintId:
          type:
            - string
            - 'null'
          example: D001
        externalId:
          type:
            - string
            - 'null'
        dispatchGroupId:
          type:
            - string
            - 'null'
          example: ABC1123-asdasdasd-123213
        deleted:
          type: boolean
        vehicleId:
          type: string
          example: D001
        vehicleExternalId:
          anyOf:
            - type: string
            - type: 'null'
        driver:
          anyOf:
            - $ref: '#/components/schemas/FuelDriver'
            - type: 'null'
        location:
          $ref: '#/components/schemas/JobLocation'
        products:
          type: array
          items:
            $ref: '#/components/schemas/DynamicFulfilmentProduct'
        shiftMetadata:
          $ref: '#/components/schemas/ShiftMetadata'
        actual:
          type:
            - object
            - 'null'
          properties:
            inboundInventory:
              type:
                - object
                - 'null'
              properties:
                compartments:
                  type: array
                  items:
                    $ref: '#/components/schemas/FuelCompartmentLoadout'
            outboundInventory:
              type:
                - object
                - 'null'
              properties:
                compartments:
                  type: array
                  items:
                    $ref: '#/components/schemas/FuelCompartmentLoadout'
            vehicleId:
              type:
                - string
                - 'null'
              example: D001
            truckReference:
              type: string
              example: D001
            timestamp:
              type:
                - string
                - 'null'
              format: date-time
            products:
              type: array
              items:
                $ref: '#/components/schemas/DynamicFulfilmentProduct'
            interactionsTransactions:
              type: array
              items:
                $ref: '#/components/schemas/FuelInteractionTransaction'
            storagesMeasurements:
              type: array
              items:
                $ref: '#/components/schemas/FuelStorageMeasurements'
            odometerDistanceKm:
              type:
                - number
                - 'null'
              description: The odometer distance reading in kilometers
    FuelStartEndActivity:
      type: object
      properties:
        id:
          type: string
          example: D001
        deleted:
          type: boolean
        dispatchGroupId:
          type:
            - string
            - 'null'
          example: ABC1123-asdasdasd-123213
        vehicleId:
          type: string
          example: D001
        vehicleExternalId:
          anyOf:
            - type: string
            - type: 'null'
        driver:
          anyOf:
            - $ref: '#/components/schemas/FuelDriver'
            - type: 'null'
        location:
          $ref: '#/components/schemas/JobLocation'
        shiftMetadata:
          $ref: '#/components/schemas/ShiftMetadata'
        actual:
          type:
            - object
            - 'null'
          properties:
            inboundProducts:
              type: array
              items:
                $ref: '#/components/schemas/DynamicFulfilmentProduct'
            inboundInventory:
              type:
                - object
                - 'null'
              properties:
                compartments:
                  type: array
                  items:
                    $ref: '#/components/schemas/FuelCompartmentLoadout'
            outboundInventory:
              type:
                - object
                - 'null'
              properties:
                compartments:
                  type: array
                  items:
                    $ref: '#/components/schemas/FuelCompartmentLoadout'
            vehicleId:
              type:
                - string
                - 'null'
              example: D001
            truckReference:
              type:
                - string
                - 'null'
              example: D001
            timestamp:
              type:
                - string
                - 'null'
              format: date-time
            products:
              type: array
              items:
                $ref: '#/components/schemas/DynamicFulfilmentProduct'
            odometerDistanceKm:
              type:
                - number
                - 'null'
              description: The odometer distance reading in kilometers
    FuelPickupActivity:
      type: object
      properties:
        id:
          type: string
          example: D001
        constraintId:
          type:
            - string
            - 'null'
          example: D001
        externalId:
          type:
            - string
            - 'null'
        dispatchGroupId:
          type:
            - string
            - 'null'
          example: ABC1123-asdasdasd-123213
        deleted:
          type: boolean
        vehicleId:
          type: string
          example: D001
        vehicleExternalId:
          anyOf:
            - type: string
            - type: 'null'
        driver:
          anyOf:
            - $ref: '#/components/schemas/FuelDriver'
            - type: 'null'
        location:
          $ref: '#/components/schemas/JobLocation'
        products:
          type: array
          items:
            $ref: '#/components/schemas/DynamicFulfilmentProduct'
        shiftMetadata:
          $ref: '#/components/schemas/ShiftMetadata'
        actual:
          type:
            - object
            - 'null'
          properties:
            inboundProducts:
              type: array
              items:
                $ref: '#/components/schemas/DynamicFulfilmentProduct'
            inboundInventory:
              type:
                - object
                - 'null'
              properties:
                compartments:
                  type: array
                  items:
                    $ref: '#/components/schemas/FuelCompartmentLoadout'
            outboundInventory:
              type:
                - object
                - 'null'
              properties:
                compartments:
                  type: array
                  items:
                    $ref: '#/components/schemas/FuelCompartmentLoadout'
            vehicleId:
              type:
                - string
                - 'null'
              example: D001
            truckReference:
              type:
                - string
                - 'null'
              example: D001
            bolLoadingReferences:
              oneOf:
                - $ref: '#/components/schemas/DynamicFulfilmentBolAssetReferences'
                - type: 'null'
            attachments:
              type: array
              items:
                $ref: '#/components/schemas/CarrierAttachment'
            timestamp:
              type:
                - string
                - 'null'
              format: date-time
            products:
              type: array
              items:
                $ref: '#/components/schemas/DynamicFulfilmentProduct'
            odometerDistanceKm:
              type:
                - number
                - 'null'
              description: The odometer distance reading in kilometers
    FuelActivities:
      type: object
      properties:
        starts:
          type: array
          items:
            $ref: '#/components/schemas/FuelStartEndActivity'
        ends:
          type: array
          items:
            $ref: '#/components/schemas/FuelStartEndActivity'
        pickups:
          type: array
          items:
            $ref: '#/components/schemas/FuelPickupActivity'
        deliveries:
          type: array
          items:
            $ref: '#/components/schemas/FuelDeliveryActivity'
        inventoryAdjust:
          type: array
          items:
            $ref: '#/components/schemas/FuelInventoryAdjustmentActivity'
    FuelShift:
      type: object
      required:
        - shiftId
        - activities
      properties:
        activities:
          $ref: '#/components/schemas/FuelActivities'
        shiftId:
          type: string
    FuelDriver:
      type: object
      required:
        - id
        - name
      properties:
        id:
          type: string
        name:
          type: string
        externalId:
          anyOf:
            - type: string
            - type: 'null'
    FuelDispatchGroupActivities:
      type: object
      properties:
        pickups:
          type: array
          items:
            $ref: '#/components/schemas/FuelPickupActivity'
        deliveries:
          type: array
          items:
            $ref: '#/components/schemas/FuelDeliveryActivity'
        inventoryAdjust:
          type: array
          items:
            $ref: '#/components/schemas/FuelInventoryAdjustmentActivity'
    DynamicFulfilmentBolAssetReferences:
      type: object
      properties:
        truck:
          type:
            - object
            - 'null'
          properties:
            reference:
              type: string
        trailers:
          type: array
          items:
            type: object
            properties:
              assetId:
                type: string
              reference:
                type: string
    CarrierAttachmentBase:
      type: object
      properties:
        attachmentId:
          type: string
        type:
          type: string
          enum:
            - attachment
            - assetBol
            - bol
        lifecycleType:
          type:
            - string
            - 'null'
          enum:
            - PICKUP
            - DELIVERY
            - ORDER
    CarrierBasicAttachment:
      allOf:
        - $ref: '#/components/schemas/CarrierAttachmentBase'
    CarrierBolAttachment:
      allOf:
        - $ref: '#/components/schemas/CarrierAttachmentBase'
    CarrierAssetBolAttachment:
      allOf:
        - $ref: '#/components/schemas/CarrierAttachmentBase'
        - type: object
          properties:
            assetType:
              type: string
              enum:
                - trailer
                - truck
            assetId:
              type: string
    CarrierAttachment:
      oneOf:
        - $ref: '#/components/schemas/CarrierBasicAttachment'
        - $ref: '#/components/schemas/CarrierAssetBolAttachment'
        - $ref: '#/components/schemas/CarrierBolAttachment'
      discriminator:
        propertyName: type
        mapping:
          attachment: '#/components/schemas/CarrierBasicAttachment'
          assetBol: '#/components/schemas/CarrierAssetBolAttachment'
          bol: '#/components/schemas/CarrierBolAttachment'
    DynamicFulfilmentProduct:
      type: object
      properties:
        transportRequirementsId:
          type: string
          description: M2X internal tracking id for the product type
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: M2X name for the product code used
          default: null
        quantity:
          type: integer
          description: The entered quantity
          default: 0
    ShiftMetadata:
      type: object
      properties:
        serviceDay:
          type: string
          format: date
        shiftId:
          type: string
        totalShifts:
          type: integer
        shiftIndex:
          type: integer
    User:
      type: object
      properties:
        uid:
          type: string
        email:
          type: string
        name:
          type: string
    JobRegions:
      type: object
      properties:
        dispatchRegionIds:
          type: array
          items:
            type: string
    Job:
      type: object
      properties:
        id:
          type: string
        shortNote:
          type: string
        updated:
          type: string
          format: date-time
        created:
          type: string
          format: date-time
        deleted:
          type: boolean
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/CarrierAttachment'
        bookedBy:
          $ref: '#/components/schemas/User'
        updatedBy:
          $ref: '#/components/schemas/User'
        reconciledBy:
          $ref: '#/components/schemas/User'
        deletedBy:
          $ref: '#/components/schemas/User'
        deliveryReference:
          type: string
          description: A reference added by the dispatcher
        truckReference:
          type: string
          description: A reference added by the driver, e.g. docket number
        senderReference:
          type:
            - string
            - 'null'
          description: A reference added by the dispatcher
        receiverReference:
          type:
            - string
            - 'null'
          description: A reference added by the dispatcher
        truckSenderReference:
          type:
            - string
            - 'null'
          description: >-
            A reference added by the driver at pickup, e.g. weighbridge docket
            number
        truckReceiverReference:
          type:
            - string
            - 'null'
          description: >-
            A reference added by the driver at delivery, e.g. weighbridge docket
            number
        truckPickupBoLReference:
          type:
            - string
            - 'null'
          description: >-
            A Bill of Lading reference added by the driver at pickup, e.g. Bill
            of Lading number
        truckDeliveryBoLReference:
          type:
            - string
            - 'null'
          description: >-
            A Bill of Lading reference added by the driver at delivery, e.g.
            Bill of Lading number
        pickupDistanceReadingKm:
          type:
            - number
            - 'null'
        deliveryDistanceReadingKm:
          type:
            - number
            - 'null'
        distanceReadingDeltaKm:
          type:
            - number
            - 'null'
          description: The odometer distance difference between pickup and delivery
        pickupEngineHoursReading:
          type:
            - number
            - 'null'
        deliveryEngineHoursReading:
          type:
            - number
            - 'null'
        engineReadingDeltaHours:
          type:
            - number
            - 'null'
          description: The engine hours difference between pickup and delivery
        externalId:
          type: string
        orderId:
          type: string
        orderFriendlyName:
          type: string
        bookingId:
          type: string
          description: If the job is linked to a corporate booking, the bookingId
        customerId:
          type: string
          description: The M2X customer id for this job
        customerExternalId:
          type: string
          description: External customer id for this job
        customerIntegrationId:
          type: string
          description: Customer integration id for this job
        customerName:
          type: string
          description: Customer name for this job
        billingGroupId:
          type: string
          description: Billing Group for this job
        humanReadableId:
          type: string
          description: Human Readable Id for this Billing group
        billingGroupStatus:
          type: string
          description: Billing Group status for this job
        pickupLocation:
          $ref: '#/components/schemas/Location'
        pickupRegions:
          $ref: '#/components/schemas/JobRegions'
        pickupTimestamp:
          type: integer
          description: Epoch timestamp (seconds since 1970) of the pickup
          deprecated: true
        taskPickupTimestamp:
          type: string
          format: date-time
          description: RFC3339 date time of the pickup
        taskStartPickupTimestamp:
          type: string
          format: date-time
          description: RFC3339 date time of arrival at the pickup site
        taskEndPickupTimestamp:
          type: string
          format: date-time
          description: RFC3339 date time of departure from the pickup site
        deliveryLocation:
          $ref: '#/components/schemas/Location'
        deliveryRegions:
          $ref: '#/components/schemas/JobRegions'
        deliveryTimestamp:
          type: integer
          description: Epoch timestamp (seconds since 1970) of the delivery
          deprecated: true
        taskDeliveryTimestamp:
          type: string
          format: date-time
          description: RFC3339 date time of the delivery
        taskStartDeliveryTimestamp:
          type: string
          format: date-time
          description: RFC3339 date time of arrival at the delivery site
        taskEndDeliveryTimestamp:
          type: string
          format: date-time
          description: RFC3339 date time of departure from the delivery site
        dispatchHub:
          type: object
          description: If the job was created from dispatch hub, the associated details
          properties:
            activityId:
              type: string
            workId:
              type: string
            type:
              type: string
            subtypes:
              type: array
              items:
                type: string
        dynamicFulfilment:
          type: object
          description: >-
            If the job was created from dynamic fulfilment, the associated
            details
          properties:
            shiftId:
              type: string
            serviceDay:
              type: string
              format: date
            pickupTaskId:
              type: string
            pickupConstraintId:
              type: string
            deliveryTaskId:
              type: string
            deliveryConstraintId:
              type: string
            dispatchGroupId:
              type: string
        vehicleId:
          type: string
        vehicleExternalId:
          type: string
        vehicleProperties:
          type: object
        assets:
          $ref: '#/components/schemas/ExecutionAssets'
        subcontractorId:
          type: string
        subcontractorExternalId:
          type: string
        subcontractorProperties:
          type: object
        transportRequirementsId:
          type: string
          description: M2X internal tracking id for the product type
        division:
          type:
            - string
            - 'null'
          description: The division of the job (e.g. bulk, general, livestock...)
          default: null
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: M2X name for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        productProperties:
          type: object
        productComponents:
          type: array
          description: The sub components of the product if present
          items:
            $ref: '#/components/schemas/ProductComponent'
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing custom properties
          default: null
        quantity:
          type: number
          description: The product quantity
          default: 0
        distanceKm:
          type: number
          description: The reference distance for the job
          default: 0
        precisionPrice:
          type:
            - number
            - 'null'
          description: The precision price for the job
          default: null
        precisionTkm:
          type:
            - number
            - 'null'
          description: The precision tonne km for the job
          default: null
        precisionKm:
          type:
            - number
            - 'null'
          description: The precision price for the job
          default: null
        precisionHr:
          type:
            - number
            - 'null'
          description: The precision Hr for the job
          default: null
        status:
          type: string
          enum:
            - Booked
            - Started
            - Delivered
            - Accepted
        invoicable:
          type: boolean
          description: Whether the job is invoiceable or not
          default: false
        priceTransport:
          type:
            - number
            - 'null'
          description: The allocated transport price
          default: null
        priceFaf:
          type:
            - number
            - 'null'
          description: The allocated FAF
          default: null
        podLink:
          type:
            - string
            - 'null'
          description: The link to the track and trace POC link
          default: null
        pocLink:
          type:
            - string
            - 'null'
          description: The link to the track and trace POD link
          default: null
        pod:
          type: object
          description: Task completion details, e.g. proof of delivery
          properties:
            pickup:
              $ref: '#/components/schemas/ProofOfDelivery'
            delivery:
              $ref: '#/components/schemas/ProofOfDelivery'
        booked:
          type: object
          properties:
            pickupLocation:
              $ref: '#/components/schemas/Location'
            pickupTimestamp:
              type: integer
              description: Epoch timestamp (seconds since 1970) of the booked pickup
            deliveryLocation:
              $ref: '#/components/schemas/Location'
            deliveryTimestamp:
              type: integer
              description: Epoch timestamp (seconds since 1970) of the booked delivery
            vehicleId:
              type: string
            productId:
              type: string
              description: M2X internal tracking id for the booked product type
            productCode:
              type:
                - string
                - 'null'
              description: M2X internal tracking id for the booked product code used
              default: null
            quantity:
              type: number
              description: The booked product quantity
              default: 0
            distanceKm:
              type: number
              description: The reference distance for the booked job
              default: 0
        docketMeasurementProperties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing docket measurement properties
          default: null
        cancellationNotes:
          type:
            - string
            - 'null'
          description: Notes for the job cancellation
          default: null
        cancellationReason:
          type:
            - string
            - 'null'
          description: Reason for the job cancellation
          default: null
    Asset:
      type: object
      properties:
        assetId:
          type: string
          description: uid for this asset
        name:
          type: string
        externalId:
          type: string
    ActionStepRecord:
      type: object
      required:
        - actionStepRecordId
        - stepId
        - stepType
        - timestamp
        - actionedBy
      properties:
        actionStepRecordId:
          type: string
          description: uid for this exact instance of step action record
          example: i8rmqV1wDDg5OkAK1F43
        stepId:
          type: string
          description: Step identifier for action associated with record
          example: weighbridgePreAdvise
        stepType:
          type: string
          description: Step type for action associated with record
          enum:
            - DECLARATION
            - EVENT
          example: EVENT
        timestamp:
          type: string
          format: date-time
          description: RFC3339 date time of step being actioned
          example: '2023-08-10T00:12:19.000+00:00'
        actionedBy:
          type: object
          description: Detail on the entity that actioned the step
          required:
            - uid
          properties:
            uid:
              type: string
              description: M2X user identifier
              example: >-
                57dbfdcfaff5f6ba545583b2e03ee1e1-E01FA786-AC09-42EC-9697-02F17EC727F8
            name:
              type:
                - string
                - 'null'
              description: Human readable name of entity, e.g. Driver's name
              example: John Doe
            role:
              type:
                - string
                - 'null'
              description: Role of entity
              example: driver
            vehicleId:
              type:
                - string
                - 'null'
              description: >-
                M2X vehicle Id associated with tracking device that actioned the
                step
              example: 5o6aiI6prkBXRprUmkTy
            vehicleLocation:
              $ref: '#/components/schemas/VehicleLocation'
        taskId:
          type:
            - string
            - 'null'
          description: Task associated with step action
          example: >-
            IIX572-qlDbkYdQDd3vcsET8nGQ-1690861908653_0_qlDbkYdQDd3vcsET8nGQ_pickup
        jobId:
          type:
            - string
            - 'null'
          description: Job associated with step action
          example: IIX572-qlDbkYdQDd3vcsET8nGQ-1690861908653_0
        transportOrderId:
          type:
            - string
            - 'null'
          description: Order associated with step action
          example: IIX572-qlDbkYdQDd3vcsET8nGQ-1690861908653
        bookingId:
          type:
            - string
            - 'null'
          description: Booking associated with step action
          example: FIN158-qlDbkYdQDd3vcsET8nGQ-1679540523856
        shiftId:
          type:
            - string
            - 'null'
          description: Shift associated with step action
          example: qlDbkYdQDd3vcsET8nGQ-5o6aiI6prkBXRprUmkTy_2023-08-01_0
    TaskUpdate:
      type: object
      required:
        - timestamp
        - quantity
      properties:
        done:
          type: boolean
        flagged:
          type: boolean
        note:
          type: string
        name:
          type: string
        truckReference:
          type: string
          description: A reference added by the driver, e.g. docket number
        quantity:
          type: number
        timestamp:
          type: integer
          format: int64
          description: Epoch timestamp (seconds since 1970) of the update
        timestampTaskStart:
          type: integer
          format: int64
          description: >-
            Epoch timestamp (seconds since 1970) when the vehicle arrived on
            site
        timestampTaskEnd:
          type: integer
          format: int64
          description: Epoch timestamp (seconds since 1970) when the vehicle left the site
    VehicleActiveTaskRequest:
      type: object
      required:
        - taskId
        - timestamp
      properties:
        taskId:
          type: string
          description: >-
            The task ID to set as active for the vehicle.  Must be a task that
            is assigned to the vehicle and not already complete.
        timestamp:
          type: integer
          format: int64
          description: Epoch timestamp (seconds since 1970) of the update
        name:
          type:
            - string
            - 'null'
          default: null
          description: The name of the user responsible for this action, if applicable
    BaseTaskProperties:
      type: object
      properties:
        id:
          type: string
        taskId:
          type: string
        vehicleId:
          type: string
        vehicleExternalId:
          type: string
        vehicleProperties:
          type: object
        deleted:
          type: boolean
          default: false
        complete:
          type: boolean
          default: false
          description: Indicate wether or not the task has been completed
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          default: null
          description: Collection of bespoke properties
        shiftMetadata:
          $ref: '#/components/schemas/ShiftMetadata'
        assets:
          $ref: '#/components/schemas/ExecutionAssets'
    MovingTaskProperties:
      type: object
      properties:
        distanceAndDuration:
          type: object
          description: Task execution details
          required:
            - arrivalLoadWeightKgs
            - arrivalTimeEpochSeconds
            - departureTimeEpochSeconds
            - distanceFromPreviousTaskMetres
            - drivingDurationFromPreviousTaskSeconds
            - handlingSeconds
          properties:
            arrivalLoadWeightKgs:
              type: integer
              description: The ArrivalLoadWeightKgs Schema
              default: 0
            arrivalTimeEpochSeconds:
              type: integer
              description: The Epoch time when the vehicle is supposed to arrive
            departureTimeEpochSeconds:
              type: integer
              description: The Epoch time when the vehicle is supposed to leave
            distanceFromPreviousTaskMetres:
              type: integer
              description: Distance driven by the vehicle from the previous task in meters
              default: 0
            drivingDurationFromPreviousTaskSeconds:
              type: integer
              description: Drive time from the previous task in meters
              default: 0
            handlingSeconds:
              type: integer
              description: Duration required to execute the task
              default: 0
        location:
          $ref: '#/components/schemas/Location'
        eventualLocation:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/Location'
    ServiceTaskProperties:
      type: object
      properties:
        type:
          type: string
          enum:
            - SERVICE
        subType:
          type: string
          enum:
            - DRIVER_SWAP
            - CLEAN
        serviceDescription:
          type: string
    CustomerTaskProperties:
      type: object
      properties:
        customerId:
          type: string
          description: The M2X customer id for this task
        customerExternalId:
          type: string
          description: External customer id for this job
        customerIntegrationId:
          type: string
          description: Customer integration id for this job
        customerName:
          type: string
          description: Customer name for this task
        billingGroupId:
          type: string
          description: Billing Group for this job
        humanReadableId:
          type: string
          description: Human Readable Id for this Billing group
        deliveryReference:
          type: string
          description: A reference added by the dispatcher
        truckReference:
          type: string
          description: A reference added by the driver, e.g. docket number
        jobId:
          type: string
          description: Reference to the job
        productDescription:
          type: string
        notesString:
          type: string
        notes:
          type: array
          description: The list of notes
          items:
            type: object
            properties:
              note:
                type: string
              noteHeader:
                type: string
              noteId:
                type: string
        product:
          type: object
          description: the payload used for this tasks
          required:
            - originalQuantity
            - productCode
            - quantity
          properties:
            id:
              type: string
            transportRequirementsId:
              type: string
              description: M2X internal tracking id for the product type
              default: ''
            originalQuantity:
              type: integer
              description: The booked quantity
              default: 0
            productCode:
              type:
                - string
                - 'null'
              description: M2X internal tracking id for the product code used
              default: null
            productCodeExternalId:
              type:
                - string
                - 'null'
              description: External Id for product tracking
              default: null
            productCodeName:
              type:
                - string
                - 'null'
              description: M2X name for the product code used
              default: null
            quantity:
              type: integer
              description: The entered quantity
              default: 0
            productComponents:
              type: array
              description: The sub components of the product if present
              items:
                $ref: '#/components/schemas/ProductComponent'
        type:
          type: string
          enum:
            - PICKUP
            - DELIVERY
        subType:
          type: string
          enum:
            - SPLIT
            - BALANCE
            - BALANCE_OFF
            - METERED
    ShiftTask:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseTaskProperties'
        - $ref: '#/components/schemas/MovingTaskProperties'
        - type: object
          properties:
            type:
              type: string
              enum:
                - START
                - DELIVERY
                - PICKUP
                - END
    CustomerTask:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseTaskProperties'
        - $ref: '#/components/schemas/MovingTaskProperties'
        - $ref: '#/components/schemas/CustomerTaskProperties'
    ServiceTask:
      type: object
      allOf:
        - $ref: '#/components/schemas/BaseTaskProperties'
        - $ref: '#/components/schemas/MovingTaskProperties'
        - $ref: '#/components/schemas/ServiceTaskProperties'
    Task:
      oneOf:
        - $ref: '#/components/schemas/ShiftTask'
        - $ref: '#/components/schemas/CustomerTask'
        - $ref: '#/components/schemas/ServiceTask'
    PublishedShift:
      type: object
      required:
        - shiftId
        - tasks
      properties:
        shiftId:
          type: string
        tasks:
          type: array
          items:
            $ref: '#/components/schemas/Task'
    Product:
      type: object
      description: A product
      properties:
        transportRequirementsId:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product type
          default: ''
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: Friendly name of the product code
          default: null
        productInvoiceName:
          type:
            - string
            - 'null'
          description: Invoice name of the product code
          default: null
        productComponents:
          anyOf:
            - type: 'null'
            - type: array
              description: The sub components of the product if present
              items:
                $ref: '#/components/schemas/ProductComponent'
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          default: null
        disabled:
          type: boolean
          description: Whether the product is usable in the front end
          default: false
        customDimensions:
          type: boolean
          description: Whether the product has any custom dimensions
          default: false
        customDimensionsDensity:
          type:
            - number
            - 'null'
          description: Product's custom density
          default: null
        customDimensionsLength:
          type:
            - number
            - 'null'
          description: Product's custom length
          default: null
        customDimensionsWidth:
          type:
            - number
            - 'null'
          description: Product's custom width
          default: null
        customDimensionsHeight:
          type:
            - number
            - 'null'
          description: Product's custom height
          default: null
        customDimensionsWeightPerUnit:
          type:
            - number
            - 'null'
          description: Product's custom eight per unit
          default: null
        customFixedLoadingTime:
          type:
            - number
            - 'null'
          description: Product's custom fixed unit loading time
        customFixedUnloadingTime:
          type:
            - number
            - 'null'
          description: Product's custom fixed unit unloading time
          default: null
        customLoadingTimePerUnit:
          type:
            - number
            - 'null'
          description: Product's custom loading time per unit
          default: null
        customUnloadingTimePerUnit:
          type:
            - number
            - 'null'
          description: Product's custom unloading time per unit
          default: null
        customDimensionsUnitsPerLift:
          type:
            - number
            - 'null'
          description: Product's custom units per lift
          default: null
        gtnCaptureEnabled:
          type: boolean
          description: >-
            Enable Gross, Tare, Net input on driver mobile when weighbridge
            available at location
          default: false
        isMix:
          type: boolean
          description: >-
            Whether or not the product is a mix of other products.  This is
            inferred from the presence of product components, but can also be
            specified explicitly in the case that there are no default
            components.  Must not be false when product components are specified
            (but can be omitted).
          default: false
        mixWrapperOnly:
          type: boolean
          description: Whether or not the product is usable only as a mix wrapper
          default: false
        mixContentOnly:
          type: boolean
          description: >-
            Whether or not the product is usable only as component in a product
            mix
          default: false
        dispatcherCanSpecifyMix:
          type: boolean
          description: >-
            Whether or not the dispatcher can specify the components making up
            the product mix
          default: false
        dispatcherCanSpecifyDimensions:
          type: boolean
          description: Whether or not the dispatcher can specify the product dimensions
          default: false
    ProductReference:
      type: object
      description: A product
      properties:
        transportRequirementsId:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product type
          default: ''
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: Friendly name of the product code
          default: null
    BillingGroupProduct:
      type: object
      description: A product
      properties:
        transportRequirementsId:
          type: string
          description: M2X internal tracking id for the product type
          default: ''
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: Friendly name of the product code
          default: null
        productInvoiceName:
          type:
            - string
            - 'null'
          description: Invoice name of the product code
          default: null
    ProductRequest:
      type: object
      description: A product
      required:
        - productCodeName
      properties:
        transportRequirementsId:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product type
          default: ''
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        productCodeName:
          type: string
          description: Friendly name of the product code
        productInvoiceName:
          type:
            - string
            - 'null'
          description: Invoice name of the product code
          default: null
        productComponents:
          type: array
          description: The sub components of the product if present
          items:
            $ref: '#/components/schemas/ProductComponentRequest'
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          default: null
        disabled:
          type: boolean
          description: Whether the product is usable in the front end
          default: false
        customDimensions:
          type: boolean
          description: Whether the product has any custom dimensions
          default: false
        customDimensionsDensity:
          type:
            - number
            - 'null'
          description: Product's custom density
          default: null
        customDimensionsLength:
          type:
            - number
            - 'null'
          description: Product's custom length
          default: null
        customDimensionsWidth:
          type:
            - number
            - 'null'
          description: Product's custom width
          default: null
        customDimensionsHeight:
          type:
            - number
            - 'null'
          description: Product's custom height
          default: null
        customDimensionsWeightPerUnit:
          type:
            - number
            - 'null'
          description: Product's custom eight per unit
          default: null
        customFixedLoadingTime:
          type:
            - number
            - 'null'
          description: Product's custom fixed unit loading time
        customFixedUnloadingTime:
          type:
            - number
            - 'null'
          description: Product's custom fixed unit unloading time
          default: null
        customLoadingTimePerUnit:
          type:
            - number
            - 'null'
          description: Product's custom loading time per unit
          default: null
        customUnloadingTimePerUnit:
          type:
            - number
            - 'null'
          description: Product's custom unloading time per unit
          default: null
        customDimensionsUnitsPerLift:
          type:
            - number
            - 'null'
          description: Product's custom units per lift
          default: null
        gtnCaptureEnabled:
          type: boolean
          description: >-
            Enable Gross, Tare, Net input on driver mobile when weighbridge
            available at location
          default: false
        isMix:
          type: boolean
          description: >-
            Whether or not the product is a mix of other products.  This is
            inferred from the presence of product components, but can also be
            specified explicitly in the case that there are no default
            components.  Must not be false when product components are specified
            (but can be omitted).
          default: false
        mixWrapperOnly:
          type: boolean
          description: Whether or not the product is usable only as a mix wrapper
          default: false
        mixContentOnly:
          type: boolean
          description: >-
            Whether or not the product is usable only as component in a product
            mix
          default: false
        dispatcherCanSpecifyMix:
          type: boolean
          description: >-
            Whether or not the dispatcher can specify the components making up
            the product mix
          default: false
        dispatcherCanSpecifyDimensions:
          type: boolean
          description: Whether or not the dispatcher can specify the product dimensions
          default: false
    ProductComponent:
      type: object
      description: A component for a product
      properties:
        proportion:
          type: number
          description: The percentage proportion of this component
          default: 0
          minimum: 0
          maximum: 100
        quantity:
          type: number
        description:
          type: string
        product:
          type: object
          description: A component for a product
          properties:
            transportRequirementsId:
              type: string
              description: M2X internal tracking id for the product type
            productCode:
              type:
                - string
                - 'null'
              description: M2X internal tracking id for the product code used
              default: null
            productCodeExternalId:
              type:
                - string
                - 'null'
              description: External Id for product tracking
              default: null
            productCodeName:
              type:
                - string
                - 'null'
              description: Friendly name of the product code
              default: null
    ProductComponentRequest:
      type: object
      description: A component for a product
      required:
        - proportion
        - product
      properties:
        proportion:
          type: number
          description: The percentage proportion of this component
          default: 0
          minimum: 0
          maximum: 100
        product:
          type: object
          description: A component for a product
          required:
            - productCode
          properties:
            productCode:
              type: string
              description: M2X internal tracking id for the product code used
    Location:
      type: object
      title: Task Location
      required:
        - addressText
        - latitude
        - locationName
        - longitude
      properties:
        addressText:
          type: string
        latitude:
          type: number
          default: 0
        longitude:
          type: number
          default: 0
        locationName:
          type: string
        locationId:
          type:
            - string
            - 'null'
          description: >-
            The M2X internal location id. When a location is manually created in
            M2X, this is a randomly generated unique identifier. If creating
            locations via API, the caller can set the Location ID.
        externalId:
          type:
            - string
            - 'null'
          description: >-
            An optional external identifier assigned to the location. This ID
            can be provided when creating the location and is typically used for
            cross-system referencing or integration with external data sources.
        timezone:
          type: string
          description: IANA (aka TZ database) timezone name
          example: Pacific/Auckland
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          default: null
    CorporateLocation:
      type: object
      title: Corporate Location
      required:
        - addressText
        - latitude
        - locationName
        - longitude
      properties:
        addressText:
          type: string
        latitude:
          type: number
          default: 0
        longitude:
          type: number
          default: 0
        locationName:
          type: string
        locationId:
          type:
            - string
            - 'null'
          description: >-
            The M2X internal location id. When a location is manually created in
            M2X, this is a randomly generated unique identifier. If creating
            locations via API, the caller can set the Location ID.
        locationOwnerId:
          type:
            - string
            - 'null'
          description: The M2X internal location owner id.
        locationVersion:
          type:
            - string
            - 'null'
          description: Version of the location for change tracking.
        externalId:
          type:
            - string
            - 'null'
          description: >-
            An optional external identifier assigned to the location. This ID
            can be provided when creating the location and is typically used for
            cross-system referencing or integration with external data sources.
        timezone:
          type: string
          description: IANA (aka TZ database) timezone name
          example: Pacific/Auckland
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          default: null
    VehicleTimelineStatementLocation:
      type: object
      title: Vehicle Timeline Statement Location
      required:
        - addressText
        - latitude
        - name
        - longitude
      properties:
        addressText:
          type: string
        latitude:
          type: number
          default: 0
        name:
          type: string
        locationId:
          type:
            - string
            - 'null'
          description: >-
            The M2X internal location id. When a location is manually created in
            M2X, this is a randomly generated unique identifier. If creating
            locations via API, the caller can set the Location ID.
        externalId:
          type:
            - string
            - 'null'
          description: >-
            An optional external identifier assigned to the location. This ID
            can be provided when creating the location and is typically used for
            cross-system referencing or integration with external data sources.
        longitude:
          type: number
          default: 0
        timezone:
          type:
            - string
            - 'null'
          description: IANA (aka TZ database) timezone name
          example: Pacific/Auckland
        ownerId:
          type:
            - string
            - 'null'
          description: >-
            The M2X internal location owner id. When a location is manually
            created in M2X, this is a randomly generated unique identifier. If
            creating locations via API, the caller can set the Location Owner
            ID.
        version:
          type:
            - string
            - 'null'
          description: >-
            The version of the location. This is used to track changes to the
            location.
    LocationGroup:
      type: object
      title: Location Group
      properties:
        groupId:
          type: string
          description: Internal M2X Location Id
        code:
          type: string
          example: C123
          description: Rapid searchable code for front end users
        externalId:
          type:
            - string
            - 'null'
          example: asd-asd-asd
          description: Id to map group to an external system
        name:
          type: string
          description: Group name
    ContactDetails:
      type: object
      title: Contact Details
      properties:
        email:
          type: string
        phone:
          type: string
        name:
          type: string
    Agent:
      type: object
      title: Agent Details
      properties:
        email:
          type:
            - string
            - 'null'
        uid:
          type:
            - string
            - 'null'
          description: M2X user identifier
        phone:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        externalId:
          type:
            - string
            - 'null'
    TimeWindows:
      type: array
      title: high accuracy time windows
      items:
        type: object
        required:
          - start
          - end
        properties:
          start:
            type: integer
            format: int64
            description: Epoch timestamp (seconds since 1970), start of the window
          end:
            type: integer
            format: int64
            description: Epoch timestamp (seconds since 1970), end of the window
    TimeConstraint:
      type: object
      properties:
        type:
          type: string
          enum:
            - NO_LATER_THAN
            - NOT_EARLIER_THAN
            - SPECIFIC_TIME
            - INTERVAL
            - NONE
        time:
          type:
            - string
            - 'null'
          description: >-
            24h time requested, only required if type is
            NO_LATER_THAN,NOT_EARLIER_THAN or SPECIFIC_TIME
          example: '11:52'
        start:
          type:
            - string
            - 'null'
          description: 24h time requested, only required if type is INTERVAL
          example: '11:52'
        end:
          type:
            - string
            - 'null'
          description: 24h time requested, only required if type is INTERVAL
          example: '14:52'
        timezone:
          type: string
          description: IANA (aka TZ database) timezone name
          example: Pacific/Auckland
      required:
        - timezone
        - type
    DateAndTimeConstraint:
      type: object
      title: Date and time constraint
      required:
        - date
        - timezone
      properties:
        date:
          type: string
          format: date
          description: Day required (YYYY-MM-DD)
        timezone:
          type: string
          description: IANA (aka TZ database) timezone name
          example: Pacific/Auckland
        timeConstraint:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimeConstraint'
    BillingGroupDetails:
      type: object
      properties:
        id:
          type: string
        humanReadableId:
          type: string
        branches:
          type: array
          items:
            $ref: '#/components/schemas/Branch'
        customerId:
          type:
            - string
            - 'null'
        customerName:
          type:
            - string
            - 'null'
        customerIntegrationId:
          type:
            - string
            - 'null'
          description: Customer integration id for this job
        customerExternalId:
          type:
            - string
            - 'null'
          description: External customer id for this job
        crnNumberByCustomerId:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Key value store of customer id and crn
        inactive:
          type: boolean
        status:
          type: string
        date:
          type: string
          format: date
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing custom properties
          default: null
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/Job'
        transportRevenues:
          type: array
          items:
            $ref: '#/components/schemas/TransportRevenue'
        storageRevenues:
          type: array
          items:
            $ref: '#/components/schemas/StorageRevenue'
        productRevenues:
          type: array
          items:
            $ref: '#/components/schemas/ProductRevenue'
        manualRevenues:
          type: array
          items:
            $ref: '#/components/schemas/ManualRevenue'
    BaseRevenue:
      type: object
      properties:
        revenueId:
          type: string
        revenueGroupId:
          type:
            - string
            - 'null'
        priceTotal:
          type: number
        timestamp:
          type:
            - string
            - 'null'
          format: date-time
          description: Date of the revenue (transport/storage etc)
        updated:
          type:
            - string
            - 'null'
          format: date-time
          description: Date the revenue was updated
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing custom properties
          default: null
        referenceCodes:
          type:
            - array
            - 'null'
          items:
            type: string
        vehicleReferenceCodes:
          type:
            - array
            - 'null'
          items:
            type: string
        vehiclePickupBoLReferences:
          type: array
          items:
            type: string
        vehicleDeliveryBoLReferences:
          type: array
          items:
            type: string
    BaseProduct:
      type: object
      properties:
        quantity:
          type: number
        massKg:
          type:
            - number
            - 'null'
        unitName:
          type: string
        spatialRequirements:
          type:
            - number
            - 'null'
          description: >-
            Could represent many dimensions, cube for bulk, area for livestock
            etc
        productDescription:
          type: string
        product:
          $ref: '#/components/schemas/BillingGroupProduct'
        productProperties:
          type:
            - object
            - 'null'
          additionalProperties: true
        productComponents:
          type: array
          description: The sub components of the product if present
          items:
            $ref: '#/components/schemas/ProductComponent'
    TransportRevenue:
      allOf:
        - $ref: '#/components/schemas/BaseRevenue'
        - $ref: '#/components/schemas/BaseProduct'
        - type: object
          properties:
            priceFaf:
              type: number
            priceTransport:
              type: number
            distanceKm:
              type:
                - number
                - 'null'
              description: The reference distance for the job
              default: 0
            pickupLocation:
              $ref: '#/components/schemas/Location'
            deliveryLocation:
              $ref: '#/components/schemas/Location'
            priceTransportDetail:
              anyOf:
                - type: 'null'
                - $ref: '#/components/schemas/PriceTransportDetail'
            priceFafDetail:
              anyOf:
                - type: 'null'
                - $ref: '#/components/schemas/PriceFafDetail'
            transportChargeId:
              type:
                - string
                - 'null'
            transportChargeName:
              type:
                - string
                - 'null'
    StorageRevenue:
      allOf:
        - $ref: '#/components/schemas/BaseRevenue'
        - $ref: '#/components/schemas/BaseProduct'
        - type: object
          properties:
            storageLocation:
              $ref: '#/components/schemas/Location'
    ProductRevenue:
      allOf:
        - $ref: '#/components/schemas/BaseRevenue'
        - $ref: '#/components/schemas/BaseProduct'
        - type: object
          properties:
            sourceLocation:
              $ref: '#/components/schemas/Location'
    ManualRevenue:
      allOf:
        - $ref: '#/components/schemas/BaseRevenue'
        - type: object
          properties:
            miscChargeId:
              type:
                - string
                - 'null'
            miscChargeName:
              type:
                - string
                - 'null'
            description:
              type:
                - string
                - 'null'
            priceTotalDetail:
              anyOf:
                - allOf:
                    - $ref: '#/components/schemas/ChargePriceDetail'
                - type: 'null'
    BillingGroup:
      type: object
      properties:
        id:
          type: string
        humanReadableId:
          type: string
        date:
          type: string
          format: date
        priceManual:
          type: number
        priceStorage:
          type: number
        priceProduct:
          type: number
        priceFaf:
          type: number
        priceTransport:
          type: number
        priceTotal:
          type: number
        from:
          type: string
        to:
          type: string
        productDescription:
          type: string
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing custom properties
          default: null
        customerId:
          type: string
        customerName:
          type: string
        customerIntegrationId:
          type: string
          description: Customer integration id for this job
        customerExternalId:
          type: string
          description: External customer id for this job
        inactive:
          type: boolean
        status:
          type: string
        vehicles:
          type: array
          description: A list of vehicles involved in a billing group execution
          items:
            type: string
        vehicleExternalIds:
          type: array
          description: A list of vehicle external Ids involved in a billing group execution
          items:
            type: string
        vehicleNames:
          type: array
          description: A list of vehicle Names involved in a billing group execution
          items:
            type: string
        vehiclesSnapshot:
          type: array
          description: >-
            A list of vehicle involved in the execution at the tome of the
            snapshot
          items:
            type: object
            properties:
              vehicleName:
                type: string
              vehicleExternalId:
                type: string
              vehicleId:
                type: string
              vehicleProperties:
                type: object
              priceFaf:
                type: number
              priceTransport:
                type: number
        subcontractors:
          type: array
          description: A list of subcontractors involved in a billing group execution
          items:
            type: string
        subcontractorExternalIds:
          type: array
          description: >-
            A list of subcontractor external Ids involved in a billing group
            execution
          items:
            type: string
        subcontractorNames:
          type: array
          description: A list of subcontractor Names involved in a billing group execution
          items:
            type: string
        subcontractorsSnapshot:
          type: array
          description: >-
            A list of subcontractor involved in the execution at the tome of the
            snapshot
          items:
            type: object
            properties:
              subcontractorName:
                type: string
              subcontractorExternalId:
                type: string
              subcontractorId:
                type: string
              subcontractorProperties:
                type: object
              priceFaf:
                type: number
              priceTransport:
                type: number
        transport:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
              date:
                type: string
                format: date
              total:
                type: number
              transport:
                type: number
              faf:
                type: number
              quantity:
                type: number
              massKg:
                type: number
              unitName:
                type: string
              spatialRequirements:
                type: number
                description: >-
                  Could represent many dimensions, cube for bulk, area for
                  livestock etc
              cartageDescriptions:
                type: array
                items:
                  type: string
              referenceCodes:
                type: array
                items:
                  type: string
              vehicleReferenceCodes:
                type: array
                items:
                  type: string
              product:
                $ref: '#/components/schemas/BillingGroupProduct'
              productProperties:
                type: object
        storage:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
              date:
                type: string
                format: date
              total:
                type: number
              quantity:
                type: number
              massKg:
                type: number
              unitName:
                type: string
              spatialRequirements:
                type: number
                description: >-
                  Could represent many dimensions, cube for bulk, area for
                  livestock etc
              storageLocations:
                type: array
                items:
                  type: string
              referenceCodes:
                type: array
                items:
                  type: string
              vehicleReferenceCodes:
                type: array
                items:
                  type: string
              product:
                $ref: '#/components/schemas/BillingGroupProduct'
              productProperties:
                type: object
        products:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
              date:
                type: string
                format: date
              total:
                type: number
              quantity:
                type: number
              massKg:
                type: number
              unitName:
                type: string
              spatialRequirements:
                type: number
                description: >-
                  Could represent many dimensions, cube for bulk, area for
                  livestock etc
              sourceLocations:
                type: array
                items:
                  type: string
              referenceCodes:
                type: array
                items:
                  type: string
              vehicleReferenceCodes:
                type: array
                items:
                  type: string
              product:
                $ref: '#/components/schemas/BillingGroupProduct'
              productProperties:
                type: object
        manual:
          type: array
          items:
            type: object
            properties:
              description:
                type: string
              date:
                type: string
                format: date
              total:
                type: number
              quantity:
                type: number
              manualItems:
                type: array
                items:
                  type: string
              referenceCodes:
                type: array
                items:
                  type: string
              vehicleReferenceCodes:
                type: array
                items:
                  type: string
    Invoice:
      type: object
      properties:
        billingGroups:
          type: array
          items:
            $ref: '#/components/schemas/BillingGroup'
        created:
          type: string
          format: date-time
        invoicedBy:
          $ref: '#/components/schemas/User'
        updated:
          type: string
          format: date-time
        status:
          type: string
        id:
          type: string
        invoiceDate:
          type: string
    VehicleTimelineStatement:
      type: object
      required:
        - id
        - vehicleId
        - serviceDay
        - deleted
        - type
        - subTypes
        - inboundAssets
        - outboundAssets
        - statementType
        - fromLocation
        - toLocation
        - metrics
      properties:
        id:
          type: string
        vehicleId:
          type: string
        serviceDay:
          type: string
        deleted:
          type: boolean
        type:
          type: string
          enum:
            - SERVICE
            - PICKUP
            - DELIVERY
            - START
            - END
        subTypes:
          type: array
          items:
            type: string
            enum:
              - CLEAN
              - WAYPOINT
              - TRAILER_SWAP
              - DRIVER_SWAP
              - ISO_CONTAINER_SWAP
        inboundAssets:
          $ref: '#/components/schemas/ExecutionAssets'
        outboundAssets:
          $ref: '#/components/schemas/ExecutionAssets'
        arrivalTimestamp:
          type: string
          format: date-time
        statementType:
          type: string
          enum:
            - BOOKED
            - VEHICLE
            - RECONCILED
            - EXECUTION_CHECKED
            - DISPATCHER_OVERRIDE
        jobIdActioned:
          type: string
        jobIdsOnBoard:
          type: array
          items:
            type: string
        mapId:
          type: string
        fromLocation:
          $ref: '#/components/schemas/VehicleTimelineStatementLocation'
        toLocation:
          $ref: '#/components/schemas/VehicleTimelineStatementLocation'
        metrics:
          type: object
          properties:
            distanceMeters:
              type: number
            driveDurationSeconds:
              type: number
            payloadKg:
              type: number
            queueDurationSeconds:
              type: number
            waitDurationSeconds:
              type: number
            serviceDurationSeconds:
              type: number
        references:
          type: object
          properties:
            deliveryReference:
              type:
                - string
                - 'null'
            fromReference:
              type:
                - string
                - 'null'
            toReference:
              type:
                - string
                - 'null'
        timeOnSite:
          type:
            - object
            - 'null'
          properties:
            arrivalTimestamp:
              type: string
              format: date-time
            departureTimestamp:
              type: string
              format: date-time
    VehicleTimelineStatementsAllocation:
      type: object
      required:
        - id
        - deleted
        - vehicleId
        - jobs
        - vehicleTimelineStatements
      properties:
        id:
          type: string
        vehicleId:
          type: string
        deleted:
          type: boolean
        jobs:
          type: array
          items:
            $ref: '#/components/schemas/ExecutionAllocation'
        vehicleTimelineStatements:
          type: array
          items:
            $ref: '#/components/schemas/ExecutionAllocation'
    VehicleTimelineStatementsAllocationDetails:
      allOf:
        - $ref: '#/components/schemas/VehicleTimelineStatementsAllocation'
        - type: object
          properties:
            vehicleTimelineStatementDetails:
              type: array
              items:
                $ref: '#/components/schemas/VehicleTimelineStatement'
    ExecutionAllocation:
      type: object
      required:
        - id
        - allocation
      properties:
        id:
          type: string
        allocation:
          type: object
          required:
            - cost
            - distanceMeters
            - durationSeconds
            - distanceMetersWeightKg
          properties:
            cost:
              type: number
            distanceMeters:
              type: number
            durationSeconds:
              type: number
            distanceMetersWeightKg:
              type: number
    ExecutionAssets:
      type: object
      properties:
        driver:
          $ref: '#/components/schemas/Asset'
        tractorUnit:
          $ref: '#/components/schemas/Asset'
        trailers:
          type: array
          items:
            $ref: '#/components/schemas/Asset'
        miscAssets:
          type: array
          items:
            $ref: '#/components/schemas/Asset'
        isoContainers:
          type: array
          items:
            $ref: '#/components/schemas/Asset'
    Booking:
      type: object
      properties:
        agent:
          $ref: '#/components/schemas/Agent'
        id:
          type: string
          description: The M2X internal booking id
        externalReference:
          type: string
        externalNote:
          type: string
        canceled:
          type: boolean
          description: >-
            Indicates whether the booking has been unallocated from the carrier.
            Note: This field does not reflect whether the booking itself has
            been canceled within the enterprise system. It only represents that
            the carrier is no longer assigned to the booking
        completed:
          type: boolean
        acknowledged:
          type: boolean
        tentative:
          type: boolean
        status:
          type: string
        slaQuality:
          type: number
        slaStatus:
          type: string
        awardCreated:
          type:
            - string
            - 'null'
          format: date-time
        requestCreated:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
        latestDeliveryTimestamp:
          type: string
          format: date-time
        earliestPickupTimestamp:
          type: string
          format: date-time
        fulfilments:
          type: array
          items:
            type: object
            properties:
              fulfilmentRequestId:
                type: string
              fulfilmentId:
                type: string
        acceptanceState:
          type:
            - object
            - 'null'
          properties:
            acceptanceDeadline:
              type: string
              format: date-time
              description: Deadline to accept the booking,
            actioned:
              type: string
              format: date-time
              description: When the acceptance was actioned
            accepted:
              type: boolean
            acceptable:
              type: boolean
            declined:
              type: boolean
            declinable:
              type: boolean
            retractable:
              type: boolean
        noPayment:
          type: boolean
          description: >-
            Whether upon acceptance the carrier shall get a payment or not (e.g.
            freight forward)
          default: false
        noPrice:
          type: boolean
          description: Whether the booking is free of charge, no offer generated
          default: false
        carrierId:
          type:
            - string
            - 'null'
          description: The M2X carrier id for this booking
        carrierExternalId:
          type:
            - string
            - 'null'
          description: External carrier id for this carrier
        carrierName:
          type:
            - string
            - 'null'
          description: Carrier name for this job
        corporateId:
          type: string
          description: The M2X corporate id for this booking
        corporateName:
          type: string
          description: Corporate name for this booking
        corporateSubaccountId:
          type: string
          description: The M2X corporate subaccount id for this booking
        corporateSubaccountName:
          type: string
          description: Corporate subaccount name for this booking
        corporateSubaccountIntegrationId:
          type: string
          description: The M2X corporate subaccount integration id for this booking
        transportRequirementsId:
          type: string
          description: M2X internal tracking id for the product type
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: M2X name for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing custom properties
          default: null
        metadata:
          $ref: '#/components/schemas/Metadata'
        content:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/Content'
          description: The sub components of the product if present
        quantity:
          type: number
          description: The product quantity
          default: 0
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Total volume or area for the booking
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Total weight for the booking
          default: null
        productNetWeightKg:
          type:
            - number
            - 'null'
          description: Net weight for the booking
          default: null
        productTareWeightKg:
          type:
            - number
            - 'null'
          description: Tare weight for the booking
          default: null
        distanceKm:
          type: number
          description: The reference distance for the job
          default: 0
        sourceId:
          type: string
          description: The source of the booking
        groupPricingStrategyGroupId:
          type:
            - string
            - 'null'
          description: Pricing group id
          default: null
        priceTransport:
          type:
            - number
            - 'null'
          description: The allocated transport price
          default: null
        priceFaf:
          type:
            - number
            - 'null'
          description: The allocated FAF
          default: null
        offerStatus:
          type: string
          description: The offer status
          default: None
        priceFafOffer:
          type:
            - number
            - 'null'
          description: The FAF offered
          default: null
        priceTransportOffer:
          type:
            - number
            - 'null'
          description: The transport price offered
          default: null
        fromLocation:
          $ref: '#/components/schemas/CorporateLocation'
        fromLocationDistrict:
          type: string
        fromLocationDistrictId:
          type:
            - string
            - 'null'
        fromLocationRegion:
          type: string
        fromDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        fromTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        fromLocationGroup:
          $ref: '#/components/schemas/LocationGroup'
        fromContactDetails:
          $ref: '#/components/schemas/ContactDetails'
        toLocation:
          $ref: '#/components/schemas/CorporateLocation'
        toLocationDistrict:
          type: string
        toLocationDistrictId:
          type:
            - string
            - 'null'
        toLocationRegion:
          type: string
        toDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        toTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        toLocationGroup:
          $ref: '#/components/schemas/LocationGroup'
        toContactDetails:
          $ref: '#/components/schemas/ContactDetails'
        masterBooking:
          description: The relevant master booking information for this booking
          $ref: '#/components/schemas/BookingMasterBookingData'
        exceptionFlagState:
          description: Status of the Exception Flag Resolution action
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/ExceptionFlagState'
    ExceptionFlagState:
      type: object
      required:
        - active
      properties:
        active:
          type: boolean
    BookingMasterBookingData:
      type: object
      properties:
        masterBookingId:
          type: string
        type:
          type: string
        shipmentId:
          type:
            - string
            - 'null'
        transportMode:
          type:
            - string
            - 'null'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        containerNumber:
          type:
            - string
            - 'null'
          description: >-
            The planned container number associated with the FULL booking. This
            value represents the expected container to be used for the shipment
            and may be subject to change as the booking progresses
        containerSealNumber:
          type:
            - string
            - 'null'
        shippingBookingReference:
          type:
            - string
            - 'null'
        customerOrderNumber:
          type:
            - string
            - 'null'
        salesOrderNumber:
          type:
            - string
            - 'null'
        purchaseOrderNumber:
          type:
            - string
            - 'null'
        shippingTemperature:
          type:
            - number
            - 'null'
        specialInstructions:
          type:
            - string
            - 'null'
        releaseNumber:
          type:
            - string
            - 'null'
        feederVessel:
          type:
            - string
            - 'null'
        feederVoyageNumber:
          type:
            - string
            - 'null'
        oceanVessel:
          type:
            - string
            - 'null'
        oceanVoyageNumber:
          type:
            - string
            - 'null'
        shippingCarrier:
          type:
            - string
            - 'null'
        dangerousGoods:
          type:
            - boolean
            - 'null'
        unNumber:
          type:
            - string
            - 'null'
        activeRefrigeration:
          type:
            - boolean
            - 'null'
        ambientTimeHours:
          type:
            - number
            - 'null'
        powerOffDateTime:
          type:
            - string
            - 'null'
        vesselArrivalDateTime:
          type:
            - string
            - 'null'
        vesselDepartureDateTime:
          type:
            - string
            - 'null'
        packDate:
          type:
            - string
            - 'null'
          format: date
        availableDate:
          type:
            - string
            - 'null'
          format: date
        portEarliestReceivalDateTime:
          type:
            - string
            - 'null'
          format: date-time
        movementSequence:
          type:
            - number
            - 'null'
        movementType:
          type:
            - string
            - 'null'
        movementTotal:
          type:
            - number
            - 'null'
        customerName:
          type:
            - string
            - 'null'
        productType:
          type: string
          enum:
            - Bulk
            - Container
            - General
            - General Freight
            - Hire
            - Livestock
            - Pallet
            - Logs
        emptyReleaseNumber:
          type:
            - string
            - 'null'
        shipCutOffDateTime:
          type:
            - string
            - 'null'
          format: date-time
        commodityCode:
          type:
            - string
            - 'null'
        commodityDescription:
          type:
            - string
            - 'null'
        connectedMovements:
          type: object
          properties:
            prior:
              type: object
              properties:
                reference:
                  type:
                    - string
                    - 'null'
                vehicleExternalId:
                  type:
                    - string
                    - 'null'
            next:
              type: object
              properties:
                reference:
                  type:
                    - string
                    - 'null'
                vehicleExternalId:
                  type:
                    - string
                    - 'null'
    CustomerBooking:
      type: object
      properties:
        id:
          type: string
        externalReference:
          type: string
        externalNote:
          type: string
        canceled:
          type: boolean
        acknowledged:
          type: boolean
        status:
          type: string
        requestCreated:
          type: string
          format: date-time
        updated:
          type: string
          format: date-time
        carrierId:
          type: string
          description: The M2X carrier id for this booking
        customerId:
          type: string
          description: Carrier customer id for this booking
        customerPortalProfileId:
          type: string
          description: Carrier customer portal profile id for this booking
        customerName:
          type: string
          description: Carrier customer name for this booking
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: M2X name for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing custom properties
          default: null
        content:
          type: array
          description: The sub components of the product if present
          items:
            $ref: '#/components/schemas/Content'
        quantity:
          type: number
          description: The product quantity
          default: 0
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Total volume or area for the booking
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Total weight for the booking
          default: null
        sourceId:
          type: string
          description: The source of the booking
        fromLocation:
          $ref: '#/components/schemas/CorporateLocation'
        fromDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        fromContactDetails:
          $ref: '#/components/schemas/ContactDetails'
        fromTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        fromReference:
          type: string
          description: The sender reference
        toLocation:
          $ref: '#/components/schemas/CorporateLocation'
        toDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        toContactDetails:
          $ref: '#/components/schemas/ContactDetails'
        toTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        toReference:
          type: string
          description: The receiver reference
    LocationMappingRequest:
      type: object
      properties:
        locationId:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the location code used
          default: null
        addressText:
          type:
            - string
            - 'null'
          description: >-
            Address, if present and no locationId or external Id is matching,
            will try to geocode
          default: null
        locationExternalId:
          type:
            - string
            - 'null'
          description: External Id
          default: null
        locationName:
          type:
            - string
            - 'null'
          description: >-
            Helps user creating the missing mapping upon mapping failure, or
            used to save location if new
          default: null
        latitude:
          type: number
          default: 0
        longitude:
          type: number
          default: 0
        saveIfUnknown:
          type: boolean
          description: >-
            If no existing location is found, locationId provided and lat/lng
            provided or geocode successful, will create location
          default: false
        locationNameResolutionEnabled:
          type: boolean
          description: >-
            Try to resolve location by name, quick weak method, disabled by
            default
          default: false
        useDefaultParentGroup:
          type: boolean
          description: If a parent location group is found, will associate location group
          default: false
        parentGroupExternalId:
          type:
            - string
            - 'null'
          description: Parent Group External Id used in case of location creation
          default: null
        parentGroupName:
          type:
            - string
            - 'null'
          description: Parent Group Name for creation if necessary
          default: null
        saveGroupIfUnknown:
          type: boolean
          description: >-
            If no existing parent location group is found, a
            parentGroupExternalId is provided, a parentGroupName is provided, a
            location needs to be created, will create group
          default: false
    CustomerBookingLocationMappingRequest:
      type: object
      properties:
        locationId:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the location code used
          default: null
        addressText:
          type:
            - string
            - 'null'
          description: >-
            Address, if present and no locationId or external Id is matching,
            will try to geocode
          default: null
        locationExternalId:
          type:
            - string
            - 'null'
          description: External Id
          default: null
        locationName:
          type:
            - string
            - 'null'
          description: >-
            Helps user creating the missing mapping upon mapping failure, or
            used to save location if new
          default: null
        latitude:
          type: number
          default: 0
        longitude:
          type: number
          default: 0
        saveIfUnknown:
          type: boolean
          description: >-
            If no existing location is found, locationId provided and lat/lng
            provided or geocode successful, will create location
          default: false
    LocationGroupMappingRequest:
      type: object
      properties:
        groupId:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the location code used
          default: null
        externalId:
          type:
            - string
            - 'null'
          description: External Id
          default: null
        usePrimaryLocation:
          type: boolean
          description: >-
            Will use primary location of this supplier. If specified, will
            ignore location
          default: false
        subLocationExternalId:
          type:
            - string
            - 'null'
          description: >-
            External Id of one of the group sub location. If specified, will
            ignore location
          default: null
    BookingRequestIntegrationStatus:
      type: object
      required:
        - batchId
        - status
        - id
      properties:
        batchId:
          type: string
          description: The batch Id returned by the booking request
          example: ABC123
        id:
          type: string
          description: The booking Id
          example: EFG456-sssss-11111
        status:
          type: string
          description: The booking request status
          enum:
            - ERROR
            - PENDING
            - SUCCESS
    CorporateSubaccountMappingRequest:
      type: object
      properties:
        corporateSubaccountId:
          type: string
          description: The M2X corporate subaccount id for this booking
        corporateSubaccountIntegrationId:
          type: string
          description: The M2X corporate subaccount integration id for this booking
    BookingMappingRequest:
      type: object
      properties:
        agent:
          type: object
          properties:
            externalId:
              type: string
              description: External agent id for this booking
        carrier:
          type: object
          properties:
            carrierExternalId:
              type: string
              description: External carrier id for this booking
        content:
          $ref: '#/components/schemas/ContentMappingRequest'
        product:
          $ref: '#/components/schemas/ProductMappingRequest'
        fromLocation:
          $ref: '#/components/schemas/LocationMappingRequest'
        fromLocationGroup:
          $ref: '#/components/schemas/LocationGroupMappingRequest'
        toLocation:
          $ref: '#/components/schemas/LocationMappingRequest'
        toLocationGroup:
          $ref: '#/components/schemas/LocationGroupMappingRequest'
        corporateSubaccount:
          $ref: '#/components/schemas/CorporateSubaccountMappingRequest'
    CustomerBookingMappingRequest:
      type: object
      properties:
        content:
          $ref: '#/components/schemas/CustomerBookingContentMappingRequest'
        product:
          $ref: '#/components/schemas/ProductMappingRequest'
        fromLocation:
          $ref: '#/components/schemas/CustomerBookingLocationMappingRequest'
        toLocation:
          $ref: '#/components/schemas/CustomerBookingLocationMappingRequest'
    CarrierCustomerBookingMappingRequest:
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/CarrierCustomerMappingRequest'
        content:
          $ref: '#/components/schemas/CustomerBookingContentMappingRequest'
        product:
          $ref: '#/components/schemas/ProductMappingRequest'
        fromLocation:
          $ref: '#/components/schemas/CustomerBookingLocationMappingRequest'
        toLocation:
          $ref: '#/components/schemas/CustomerBookingLocationMappingRequest'
    BookingRequest:
      type: object
      properties:
        agent:
          $ref: '#/components/schemas/Agent'
        externalReference:
          type: string
        externalNote:
          type: string
        carrierId:
          type: string
          description: The M2X carrier id for this booking
        canceled:
          type: boolean
        completed:
          type: boolean
        quantity:
          type: number
          description: The product quantity
          default: 0
        noPayment:
          type: boolean
          description: >-
            Whether upon acceptance the carrier shall get a payment or not (e.g.
            freight forward)
          default: false
        noPrice:
          type: boolean
          description: Whether the booking is free of charge, no offer generated
          default: false
        properties:
          $ref: '#/components/schemas/CustomProperties'
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Optional override for the volume
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Optional total weight override for the booking
          default: null
        productNetWeightKg:
          type:
            - number
            - 'null'
          description: Optional net weight override for the booking
          default: null
        productTareWeightKg:
          type:
            - number
            - 'null'
          description: Optional tare weight override for the booking
          default: null
        metadata:
          $ref: '#/components/schemas/Metadata'
        fromLocation:
          $ref: '#/components/schemas/Location'
        fromDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        fromTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        fromLocationGroup:
          $ref: '#/components/schemas/LocationGroup'
        fromContactDetails:
          $ref: '#/components/schemas/ContactDetails'
        toLocation:
          $ref: '#/components/schemas/Location'
        toDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        toTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        toLocationGroup:
          $ref: '#/components/schemas/LocationGroup'
        toContactDetails:
          $ref: '#/components/schemas/ContactDetails'
    CustomerBookingRequest:
      type: object
      properties:
        externalReference:
          type: string
        externalNote:
          type: string
        canceled:
          type: boolean
        properties:
          $ref: '#/components/schemas/CustomProperties'
        quantity:
          type: number
          description: The product quantity
          default: 0
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Optional override for the volume
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Optional total weight override for the booking
          default: null
        fromLocation:
          $ref: '#/components/schemas/Location'
        fromReference:
          type: string
          description: The sender's reference
        fromDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        fromContactDetails:
          $ref: '#/components/schemas/ContactDetails'
        toLocation:
          $ref: '#/components/schemas/Location'
        toReference:
          type: string
          description: The receiver's reference
        toDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        toContactDetails:
          $ref: '#/components/schemas/ContactDetails'
    CorporateNodeRequest:
      type: object
      required:
        - orderDay
        - locationDate
        - locationDateFlexibility
      properties:
        agent:
          $ref: '#/components/schemas/Agent'
        externalReference:
          type: string
        externalNote:
          type: string
        quantity:
          type: number
          description: The product quantity
          default: 0
        properties:
          $ref: '#/components/schemas/CustomProperties'
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Optional override for the volume
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Optional total weight override for the booking
          default: null
        metadata:
          $ref: '#/components/schemas/Metadata'
        location:
          $ref: '#/components/schemas/Location'
        locationGroup:
          $ref: '#/components/schemas/LocationGroup'
        contactDetails:
          $ref: '#/components/schemas/ContactDetails'
        orderDay:
          type: string
          format: date
          description: >-
            The date from where the node will be available for dispatch, if not
            provided, assume today
        locationDate:
          type: string
          format: date
          description: The date of interaction
        locationDateFlexibility:
          type: string
          enum:
            - AFTER
            - EXACT
            - BEFORE
    CorporateNodeMappingRequest:
      type: object
      properties:
        agent:
          type: object
          properties:
            externalId:
              type: string
              description: External agent id for this booking
        product:
          $ref: '#/components/schemas/ProductMappingRequest'
        products:
          type: array
          items:
            $ref: '#/components/schemas/ProductMappingRequest'
        location:
          $ref: '#/components/schemas/LocationMappingRequest'
        locationGroup:
          $ref: '#/components/schemas/LocationGroupMappingRequest'
    Fulfilment:
      type: object
      properties:
        id:
          type: string
        bookingId:
          type: string
        acted:
          type: boolean
          description: True when the grace period has expired and users can't go back
          default: false
        done:
          type: boolean
          description: Whether the user has completed it
          default: false
        content:
          $ref: '#/components/schemas/ContentFulfilled'
        requestedQuantity:
          type: number
          description: The product quantity
          default: 0
        quantity:
          type: number
          description: The product quantity
          default: 0
        type:
          type: string
          enum:
            - cancel
            - fulfil
          description: Fulfilment type
          default: fulfil
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Optional override for the volume
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Optional total weight override for the booking
          default: null
        offerStatus:
          type: string
          description: The offer status
          default: None
        offerPriceFaf:
          type:
            - number
            - 'null'
          description: The FAF offered
          default: null
        offerPriceTransport:
          type:
            - number
            - 'null'
          description: The transport price offered
          default: null
        bookingPriceFaf:
          type:
            - number
            - 'null'
          description: The FAF booked
          default: null
        bookingPriceTransport:
          type:
            - number
            - 'null'
          description: The transport price booked
          default: null
        siteStatus:
          type: string
          description: Status of the fulfilment at the site
          default: pending
        siteOnHoldReason:
          type:
            - string
            - 'null'
          description: Reason for the fulfilment to be on hold at a site
          default: null
    BaseFulfilmentRequest:
      type: object
      properties:
        id:
          type: string
        externalReference:
          type: string
        externalNote:
          type: string
        internalNote:
          type: string
        remainerCanceled:
          type: boolean
          description: Whether the remaining items are not fulfilled
        labels:
          type: array
          description: Extra label for picking
          items:
            type: string
        noPayment:
          type: boolean
          description: >-
            Whether upon acceptance the carrier shall get a payment or not (e.g.
            freight forward)
          default: false
        noPrice:
          type: boolean
          description: Whether the booking is free of charge, no offer generated
          default: false
        carrierId:
          type: string
          description: The M2X carrier id for this booking
        carrierExternalId:
          type: string
          description: External carrier id for this carrier
        carrierName:
          type: string
          description: Carrier name for this job
        corporateId:
          type: string
          description: The M2X corporate id for this booking
        corporateName:
          type: string
          description: Corporate name for this job
        backOrder:
          type: boolean
        urgent:
          type: boolean
        updated:
          type: string
          format: date-time
        requestedQuantity:
          type: number
          description: The product quantity
          default: 0
        quantity:
          type: number
          description: The product quantity
          default: 0
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Optional override for the volume
          default: null
        productSpatialRequirementPerUnit:
          type:
            - number
            - 'null'
          description: Optional override for the volume per unit
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Optional total weight override for the booking
          default: null
        productMassKgPerUnit:
          type:
            - number
            - 'null'
          description: Optional total weight override for the booking per unit
          default: null
        transportRequirementsId:
          type: string
          description: M2X internal tracking id for the product type
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: M2X name for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        content:
          $ref: '#/components/schemas/ContentFulfilled'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        fromLocation:
          $ref: '#/components/schemas/CorporateLocation'
        fromDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        fromTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        fromLocationGroup:
          $ref: '#/components/schemas/LocationGroup'
        fromContactDetails:
          $ref: '#/components/schemas/ContactDetails'
        toLocation:
          $ref: '#/components/schemas/CorporateLocation'
        toDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        toTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        toLocationGroup:
          $ref: '#/components/schemas/LocationGroup'
        toContactDetails:
          $ref: '#/components/schemas/ContactDetails'
    FulfilmentRequest:
      allOf:
        - $ref: '#/components/schemas/BaseFulfilmentRequest'
        - type: object
          properties:
            fulfilments:
              type: array
              description: The list of fulfilment associated with the fulfilmentRequest
              items:
                $ref: '#/components/schemas/Fulfilment'
    SiteFulfilmentRequest:
      allOf:
        - $ref: '#/components/schemas/BaseFulfilmentRequest'
        - $ref: '#/components/schemas/Fulfilment'
        - type: object
          properties:
            fulfilmentId:
              type: string
              description: The instance of fulfilment attempt
            fulfilmentRequestId:
              type: string
              description: The instance of fulfilment request, duplicate of Id
    SiteFulfilment:
      type: object
      properties:
        fulfilmentRequest:
          $ref: '#/components/schemas/SiteFulfilmentRequest'
        site:
          type: object
          properties:
            description:
              type: string
            name:
              type: string
            siteId:
              type: string
            locationGroupId:
              type: string
            locationGroupName:
              type: string
        status:
          type: string
        updated:
          type: string
          format: date-time
        extras:
          type: object
          properties:
            backOrder:
              type: boolean
            urgent:
              type: boolean
            bookingGroup:
              type: string
            labels:
              type: array
              items:
                type: string
        assignment:
          type: object
          properties:
            name:
              type: string
            operatorId:
              type: string
            code:
              type: string
    FulfilmentRequestRequest:
      type: object
      properties:
        externalReference:
          type: string
        externalNote:
          type: string
        internalNote:
          type: string
        backOrder:
          type: boolean
        urgent:
          type: boolean
        labels:
          type: array
          description: Extra labels for picking
          items:
            type: string
        noPayment:
          type: boolean
          description: >-
            Whether upon acceptance the carrier shall get a payment or not (e.g.
            freight forward)
          default: false
        noPrice:
          type: boolean
          description: Whether the booking is free of charge, no offer generated
          default: false
        requestedQuantity:
          type: number
          description: The product quantity
          default: 0
        massKgPerUnit:
          type: number
          description: Optional override for the weight per unit
        spatialRequirementPerUnit:
          type: number
          description: Optional override for the volume per unit
        fromDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        fromTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        fromContactDetails:
          $ref: '#/components/schemas/ContactDetails'
        toContactDetails:
          $ref: '#/components/schemas/ContactDetails'
        toDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        toTimeWindows:
          $ref: '#/components/schemas/TimeWindows'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
    FulfilmentRequestMappingRequest:
      type: object
      properties:
        carrier:
          type: object
          properties:
            carrierExternalId:
              type: string
              description: External carrier id for this booking
        content:
          $ref: '#/components/schemas/ContentRequestMappingRequest'
        product:
          $ref: '#/components/schemas/ProductMappingRequest'
        fromLocation:
          $ref: '#/components/schemas/LocationMappingRequest'
        fromLocationGroup:
          $ref: '#/components/schemas/LocationGroupMappingRequest'
        toLocation:
          $ref: '#/components/schemas/LocationMappingRequest'
        toLocationGroup:
          $ref: '#/components/schemas/LocationGroupMappingRequest'
    BookingEvent:
      type: object
      properties:
        id:
          type: string
        canceled:
          type: boolean
        bookingId:
          type: string
        event:
          type: string
          enum:
            - load
            - unload
            - vehicleAssignment
            - pickup
            - pickupEta
            - gateIn
            - delivery
            - deliveryEta
            - gateOut
            - exceptionFlag
            - clearExceptionFlag
            - manifest
            - offload
            - arrivedAtPickup
            - uplift
            - subcontractCheck
            - truckDairyPump
        version:
          type:
            - string
            - 'null'
        status:
          anyOf:
            - type: 'null'
            - type: string
              enum:
                - partial
                - completed
                - Complete
                - vehicleCompleted
                - checked
                - reconciled
                - corporateReconciled
        vehicle:
          type:
            - object
            - 'null'
          properties:
            vehicleName:
              type:
                - string
                - 'null'
            vehicleId:
              type:
                - string
                - 'null'
            vehicleExternalId:
              type:
                - string
                - 'null'
            registration:
              type:
                - string
                - 'null'
            vehicleType:
              type:
                - string
                - 'null'
            weightClass:
              type:
                - number
                - 'null'
            weightClassLabel:
              type:
                - string
                - 'null'
            driverId:
              type:
                - string
                - 'null'
            driverExternalId:
              type:
                - string
                - 'null'
            driverName:
              type:
                - string
                - 'null'
        timeWindow:
          type:
            - object
            - 'null'
          properties:
            start:
              type: string
              format: date-time
            end:
              type: string
              format: date-time
        note:
          type:
            - string
            - 'null'
        reference:
          type:
            - string
            - 'null'
        actualId:
          type:
            - string
            - 'null'
        deliveryReference:
          type:
            - string
            - 'null'
        truckReference:
          type:
            - string
            - 'null'
        flagReason:
          type:
            - string
            - 'null'
          description: >-
            For exception events, flagReason is populated with the reason of
            exception
        resolutionReason:
          type:
            - string
            - 'null'
          description: Populated with comment made while clearing exception events
        created:
          type: string
          format: date-time
        serverCreated:
          type:
            - string
            - 'null'
          format: date-time
        actual:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/BookingEventActual'
        attachments:
          anyOf:
            - type: 'null'
            - type: array
              items:
                $ref: '#/components/schemas/BookingEventAttachment'
    BookingEventRequest:
      type: object
      properties:
        event:
          type: string
          enum:
            - load
            - unload
        status:
          type: string
          enum:
            - partial
            - completed
        note:
          type: string
        reference:
          type: string
        actualId:
          type: string
        created:
          type: string
          format: date-time
        actual:
          type: object
          properties:
            quantity:
              type: number
              description: The product quantity
              default: 0
            properties:
              $ref: '#/components/schemas/CustomProperties'
            productSpatialRequirement:
              type:
                - number
                - 'null'
              description: Optional override for the volume
              default: null
            productMassKg:
              type:
                - number
                - 'null'
              description: Optional total weight override for the booking
              default: null
            productNetWeightKg:
              type:
                - number
                - 'null'
              description: Optional net weight override for the booking
              default: null
            productTareWeightKg:
              type:
                - number
                - 'null'
              description: Optional tare weight override for the booking
              default: null
            metadata:
              $ref: '#/components/schemas/Metadata'
            product:
              $ref: '#/components/schemas/ProductMappingRequest'
            content:
              $ref: '#/components/schemas/ContentMappingRequest'
    BookingEventActual:
      type: object
      properties:
        quantity:
          type:
            - number
            - 'null'
          description: The product quantity
          default: 0
        properties:
          $ref: '#/components/schemas/CustomProperties'
        groupEventId:
          type:
            - string
            - 'null'
          description: >-
            An id to signify that the event happened simultaneously with order
            events
          default: null
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Optional override for the volume
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Optional total weight override for the booking
          default: null
        productNetWeightKg:
          type:
            - number
            - 'null'
          description: Optional net weight override for the booking
          default: null
        productTareWeightKg:
          type:
            - number
            - 'null'
          description: Optional tare weight override for the booking
          default: null
        metadata:
          $ref: '#/components/schemas/Metadata'
        transportRequirementsId:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product type
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: M2X name for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        eventGroupId:
          type:
            - string
            - 'null'
        masterBooking:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/BookingMasterBookingData'
        content:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/Content'
        locationDescription:
          type: string
          description: Human readable location description
          example: at plant xxx
    BookingEventAttachment:
      type: object
      required:
        - attachmentId
        - updated
        - downloadUrl
      properties:
        attachmentId:
          type: string
          description: The attachment ID
        name:
          type:
            - string
            - 'null'
          description: File name
        updated:
          type: string
          description: File last updated
          format: date-time
        downloadUrl:
          type:
            - string
            - 'null'
          description: URL where booking event attachment can be downloaded from
          example: >-
            apis/v0/resources/downloads/bookingEvents/TGX854-sY2JY6P149xm9sOtp4Jx-1670743772224/attachments/LVB348-1722451114347
          format: uri
    Offer:
      type: object
      properties:
        id:
          type: string
        references:
          type: array
          items:
            type: string
        offerVersion:
          type: string
        bookingId:
          type: string
        canceled:
          type: boolean
        carrierId:
          type: string
          description: The M2X carrier id for this offer
        carrierExternalId:
          type: string
          description: External carrier ids for this carrier
        carrierName:
          type: string
          description: Carrier name for this job
        corporateId:
          type: string
          description: The M2X corporate id for this offer
        corporateName:
          type: string
          description: Corporate name for this job
        corporateSubaccountId:
          type: string
          description: The M2X corporate subaccount id for this offer
        corporateSubaccountName:
          type: string
          description: Corporate subaccount name for this offer
        corporateSubaccountIntegrationId:
          type: string
          description: The M2X corporate subaccount integration id for this booking
        transportRequirementsId:
          type: string
          description: M2X internal tracking id for the product type
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: M2X name for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        properties:
          $ref: '#/components/schemas/CustomProperties'
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Total volume or area for the booking
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Total weight for the booking
          default: null
        content:
          type: array
          description: The sub components of the product if present
          items:
            $ref: '#/components/schemas/Content'
        quantity:
          type: number
          description: The product quantity
          default: 0
        noPayment:
          type: boolean
          description: >-
            Whether upon acceptance the carrier shall get a payment or not (e.g.
            freight forward)
          default: false
        distanceKm:
          type: number
          description: The reference distance for the job
          default: 0
        sourceId:
          type: string
          description: The source of the offer
        priceTransport:
          type:
            - number
            - 'null'
          description: The allocated transport price
          default: null
        priceFaf:
          type:
            - number
            - 'null'
          description: The allocated FAF
          default: null
        priceStrategy:
          type:
            - string
            - 'null'
          enum:
            - Deferred
            - Fixed
            - Group
            - Precision
            - Provided
          description: The pricing strategy for the offer
          default: null
        priceTransportAdjustmentReasons:
          type: array
          items:
            type: string
        priceTransportAdjustment:
          type:
            - number
            - 'null'
          description: The amount for the adjustment
          default: null
        fromLocation:
          $ref: '#/components/schemas/Location'
        fromLocationDistrict:
          type: string
        fromLocationDistrictId:
          type: string
        fromLocationRegion:
          type: string
        toLocation:
          $ref: '#/components/schemas/Location'
        toLocationDistrict:
          type: string
        toLocationDistrictId:
          type: string
        toLocationRegion:
          type: string
        transportTimestamp:
          type: string
          format: date-time
          description: RFC3339 date time of cart
        settled:
          type: boolean
          description: Whether the offer is accepted by the carrier
        queried:
          type: boolean
          description: Whether the offer is being queried by the carrier
        status:
          type: string
          enum:
            - Delivered
            - Queried
            - Accepted
            - Invoiced
            - Paid
            - Completed
    OfferMappingRequest:
      type: object
      properties:
        carrier:
          type: object
          properties:
            carrierExternalId:
              type: string
              description: External carrier id for this booking
        content:
          $ref: '#/components/schemas/ContentMappingRequest'
        product:
          $ref: '#/components/schemas/ProductMappingRequest'
        fromLocation:
          $ref: '#/components/schemas/LocationMappingRequest'
        fromLocationGroup:
          $ref: '#/components/schemas/LocationGroupMappingRequest'
        toLocation:
          $ref: '#/components/schemas/LocationMappingRequest'
        toLocationGroup:
          $ref: '#/components/schemas/LocationGroupMappingRequest'
    OfferRequest:
      type: object
      properties:
        references:
          type: array
          items:
            type: string
        offerVersion:
          type: string
        bookingId:
          type: string
        carrierId:
          type: string
          description: The M2X carrier id for this offer
        quantity:
          type: number
          description: The product quantity
          default: 0
        properties:
          $ref: '#/components/schemas/CustomProperties'
        noPayment:
          type: boolean
          description: >-
            Whether upon acceptance the carrier shall get a payment or not (e.g.
            freight forward)
          default: false
        productSpatialRequirement:
          type:
            - number
            - 'null'
          description: Optional override for the volume
          default: null
        productMassKg:
          type:
            - number
            - 'null'
          description: Optional total weight override for the booking
          default: null
        metadata:
          $ref: '#/components/schemas/Metadata'
        priceTransport:
          type:
            - number
            - 'null'
          description: The allocated transport price
          default: null
        priceFaf:
          type:
            - number
            - 'null'
          description: The allocated FAF
          default: null
        fromLocation:
          $ref: '#/components/schemas/Location'
        toLocation:
          $ref: '#/components/schemas/Location'
        transportTimestamp:
          type: string
          format: date-time
          description: RFC3339 date time of cart
    ProductMappingRequest:
      type: object
      properties:
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        productDescription:
          type:
            - string
            - 'null'
          description: Helps user creating the missing mapping upon mapping failure
          default: null
    ContentRequestMappingRequest:
      type:
        - object
        - 'null'
      description: Specific information about the content of the booking
      default: null
      properties:
        description:
          type: string
          description: Description of the payload
        productBundle:
          type: object
          description: Details of the products carted
          properties:
            payload:
              type: array
              items:
                type: object
                properties:
                  description:
                    type: string
                  itemId:
                    type: string
                  requestedQuantity:
                    type: number
                    description: This item quantity
                  massKgPerUnit:
                    type: number
                    description: Optional override for the weight per unit
                  spatialRequirementPerUnit:
                    type: number
                    description: Optional override for the volume per unit
                  unitOfMeasure:
                    type: string
                    description: Optional unit of measure (e.g. bags)
                  product:
                    $ref: '#/components/schemas/ProductMappingRequest'
                  metadata:
                    $ref: '#/components/schemas/Metadata'
                  properties:
                    $ref: '#/components/schemas/CustomProperties'
                  propertyRequests:
                    type: array
                    items:
                      type: object
                      properties:
                        fieldId:
                          type: string
                          description: The property field to fill
                        fieldLabel:
                          type: string
                          description: The property field label for the UI
                        type:
                          type: string
                          description: The type of input
                          enum:
                            - select
                            - selectWithQuantity
                            - string
                            - stringWithQuantity
                            - boolean
                            - number
                        items:
                          type: array
                          description: In case of a select the items to select from
                          items:
                            type: object
                            properties:
                              text:
                                type: string
                              value:
                                type: string
    ContentFulfilled:
      type:
        - object
        - 'null'
      description: Specific information about the content of the booking
      default: null
      properties:
        description:
          type:
            - string
            - 'null'
          description: Description of the payload
        productBundle:
          type: object
          description: Details of the products carted
          properties:
            payload:
              type: array
              items:
                $ref: '#/components/schemas/ProductBundlePayloadItemFulfilled'
            supplimentary:
              type: array
              description: >-
                Details of the products carted that are not considered part of
                the actual payload
              items:
                $ref: '#/components/schemas/ProductBundlePayloadItemFulfilled'
    ProductBundlePayloadItemFulfilled:
      type: object
      properties:
        requestedQuantity:
          type: number
          description: This item requested quantity
        quantity:
          type: number
          description: This item quantity
        description:
          type: string
        itemId:
          type: string
        massKg:
          type: number
          description: Optional override for the weight
        massKgPerUnit:
          type: number
          description: Optional override for the weight per unit
        spatialRequirement:
          type: number
          description: Optional override for the volume
        spatialRequirementPerUnit:
          type: number
          description: Optional override for the volume per unit
        unitOfMeasure:
          type: string
          description: Optional unit of measure (e.g. bags)
        product:
          $ref: '#/components/schemas/ProductReference'
        metadata:
          $ref: '#/components/schemas/Metadata'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        propertyRequests:
          type:
            - array
            - 'null'
          items:
            type: object
            properties:
              fieldId:
                type: string
                description: The property field to fill
              fieldLabel:
                type: string
                description: The property field label for the UI
              type:
                type: string
                description: The type of input
                enum:
                  - select
                  - selectWithQuantity
                  - string
                  - stringWithQuantity
                  - boolean
                  - number
              items:
                type: array
                description: In case of a select the items to select from
                items:
                  type: object
                  properties:
                    text:
                      type: string
                    value:
                      type: string
    ContentMappingRequest:
      type:
        - object
        - 'null'
      description: Specific information about the content of the booking
      default: null
      properties:
        description:
          type: string
          description: Description of the payload
        productBundle:
          type: object
          description: Details of the products carted
          properties:
            payload:
              type: array
              items:
                type: object
                properties:
                  itemId:
                    type: string
                  quantity:
                    type: number
                    description: This item quantity
                  description:
                    type: string
                  massKg:
                    type: number
                    description: Optional override for the weight
                  spatialRequirement:
                    type: number
                    description: Optional override for the volume
                  unitOfMeasure:
                    type: string
                    description: Optional unit of measure (e.g. bags)
                  product:
                    $ref: '#/components/schemas/ProductMappingRequest'
                  metadata:
                    $ref: '#/components/schemas/Metadata'
                  properties:
                    $ref: '#/components/schemas/CustomProperties'
    CustomerBookingContentMappingRequest:
      type:
        - object
        - 'null'
      description: Specific information about the content of the booking
      default: null
      properties:
        description:
          type: string
          description: Description of the payload
        productBundle:
          type: object
          description: Details of the products carted
          properties:
            payload:
              type: array
              items:
                type: object
                properties:
                  quantity:
                    type: number
                    description: This item quantity
                  description:
                    type: string
                  massKg:
                    type: number
                    description: Optional override for the weight in kg
                  spatialRequirement:
                    type: number
                    description: Optional override for the volume in cubic meter
                  pltOrBin:
                    type: number
                    description: >-
                      Optional, pallet or bins quantity for general freight
                      products
                  notes:
                    type: string
                    description: Optional notes
                  product:
                    $ref: '#/components/schemas/ProductMappingRequest'
                  properties:
                    $ref: '#/components/schemas/CustomProperties'
    Content:
      type:
        - object
        - 'null'
      description: Specific information about the content of the booking
      default: null
      properties:
        description:
          type:
            - string
            - 'null'
          description: Description of the payload
        productBundle:
          type: object
          description: Details of the products carted
          properties:
            readonly:
              type: boolean
              description: >-
                True if there is no expectation for driver to amend actuals
                during pickup or delivery
              default: false
            payload:
              type: array
              items:
                $ref: '#/components/schemas/ProductBundlePayloadItem'
            supplimentary:
              type: array
              description: >-
                Details of the products carted that are not considered part of
                the actual payload
              items:
                $ref: '#/components/schemas/ProductBundlePayloadItem'
    ProductBundlePayloadItem:
      type: object
      properties:
        quantity:
          type:
            - number
            - 'null'
          description: This item quantity
        description:
          type:
            - string
            - 'null'
        itemId:
          type:
            - string
            - 'null'
        massKg:
          type:
            - number
            - 'null'
          description: Optional override for the weight
        netWeightKg:
          type:
            - number
            - 'null'
          description: Optional the net weight of the product line item
        tareWeightKg:
          type:
            - number
            - 'null'
          description: Optional the net weight of the product line item
        spatialRequirement:
          type:
            - number
            - 'null'
          description: Optional override for the volume
        unitOfMeasure:
          type:
            - string
            - 'null'
          description: Optional unit of measure (e.g. bags)
        productCode:
          allOf:
            - $ref: '#/components/schemas/Product'
            - description: Note productCode has been deprecated in favour of product
            - deprecated: true
        product:
          $ref: '#/components/schemas/ProductReference'
        commodityCode:
          type:
            - string
            - 'null'
          description: optional commodity code
        commodityDescription:
          type:
            - string
            - 'null'
          description: optional commodity description
        orderNumber:
          type:
            - string
            - 'null'
          description: optional order number
        metadata:
          $ref: '#/components/schemas/Metadata'
        properties:
          $ref: '#/components/schemas/CustomProperties'
    BulkResponse:
      type: object
      title: Bulk Response
      properties:
        success:
          type: boolean
          example: true
        batchId:
          type: string
          example: ABC123
    ActivityMasterBookingData:
      type: object
      description: Optional master booking data
      properties:
        containerNumber:
          type: string
          description: The container number
        containerSealNumber:
          type: string
          description: The container seal number
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: >-
            A key value store containing bespoke properties usable for pricing
            and optimisation
          default: null
    ActivityEta:
      type: object
      required:
        - timeWindow
        - timestamp
      properties:
        timeWindow:
          $ref: '#/components/schemas/TimeWindow'
        timestamp:
          type: string
          format: date-time
          description: RFC3339 time of the event
        onWay:
          type: boolean
          description: Whether the next activity of the truck is this activity
        vehicleLocation:
          $ref: '#/components/schemas/VehicleLocation'
        distanceKmToActivity:
          type: number
          description: Driving distance to the activity
        contact:
          allOf:
            - $ref: '#/components/schemas/ContactDetails'
            - description: Dispatcher contact details
        registration:
          type: string
          example: ABC123
        vehicleId:
          type: string
          example: T001
          description: >-
            A vehicle identifier that will make sense to the dispatcher and the
            customer
        vehicleExternalId:
          type: string
          example: T001
          description: >-
            A vehicle external identifier that will make sense to the dispatcher
            and the customer
        reference:
          type: string
          example: ABC123
    ArrivedAtActivityLocation:
      type: object
      required:
        - timestamp
      properties:
        timestamp:
          type: string
          format: date-time
          description: RFC3339 time of the event
        vehicleLocation:
          $ref: '#/components/schemas/VehicleLocation'
        locationDescription:
          type: string
          description: Human readable location description
          example: at plant xxx
        contact:
          allOf:
            - $ref: '#/components/schemas/ContactDetails'
            - description: Dispatcher contact details
        registration:
          type: string
          example: ABC123
        vehicleId:
          type: string
          example: T001
          description: >-
            A vehicle identifier that will make sense to the dispatcher and the
            customer
        vehicleExternalId:
          type: string
          example: T001
          description: >-
            A vehicle external identifier that will make sense to the dispatcher
            and the customer
    ActivityExecution:
      type: object
      required:
        - timestamp
      properties:
        timestamp:
          type: string
          format: date-time
          description: RFC3339 time of the event
        vehicleLocation:
          $ref: '#/components/schemas/VehicleLocation'
        locationDescription:
          type: string
          description: Human readable location description
          example: at plant xxx
        contact:
          allOf:
            - $ref: '#/components/schemas/ContactDetails'
            - description: Dispatcher contact details
        reference:
          type: string
          example: docket 123
        registration:
          type: string
          example: ABC123
        vehicleId:
          type: string
          example: T001
          description: >-
            A vehicle identifier that will make sense to the dispatcher and the
            customer
        vehicleExternalId:
          type: string
          example: T001
          description: >-
            A vehicle external identifier that will make sense to the dispatcher
            and the customer
        quantity:
          type: number
          description: >-
            Quantity of product on the vehicle, if not set, assume booked
            quantity
        massKg:
          type: number
          description: Weight of product on the vehicle if quantity does not imply it
        netWeightKg:
          type: number
          description: The net weight of the product on the vehicle
        tareWeightKg:
          type: number
          description: The tare weight of the product on the vehicle
        spatialRequirements:
          type: number
          description: >-
            Could represent many dimensions, cube for bulk, area for livestock
            etc if quantity does not imply it
        productBundle:
          type: object
          description: details of the product components
          properties:
            payload:
              type: array
              items:
                type: object
                properties:
                  itemId:
                    type: string
                  quantity:
                    type: number
                    description: this item quantity
                  description:
                    type: string
                  massKg:
                    type: number
                    description: optional override for the weight
                  netWeightKg:
                    type: number
                    description: the net weight of the product line item
                  tareWeightKg:
                    type: number
                    description: the net weight of the product line item
                  spatialRequirement:
                    type: number
                    description: optional override for the volume
                  unitOfMeasure:
                    type: string
                    description: optional unit of measure (e.g. bags)
                  product:
                    $ref: '#/components/schemas/ProductMappingRequest'
                  commodityCode:
                    type: string
                    description: optional commodity code
                  commodityDescription:
                    type: string
                    description: optional commodity description
                  orderNumber:
                    type: string
                    description: optional order number
                  metadata:
                    type: object
                    description: opaque passenger data
                    default: null
                  properties:
                    type: object
                    description: >-
                      a key value store containing bespoke properties usable for
                      pricing and optimisation
                    default: null
        masterBooking:
          $ref: '#/components/schemas/ActivityMasterBookingData'
    ActivityGateInteraction:
      type: object
      required:
        - timestamp
      properties:
        timestamp:
          type: string
          format: date-time
          description: RFC3339 time of the event
        netWeightKg:
          type: number
          description: The net weight of the product on the vehicle
        tareWeightKg:
          type: number
          description: The tare weight of the product on the vehicle
        masterBooking:
          $ref: '#/components/schemas/ActivityMasterBookingData'
        vehicleId:
          type: string
          example: T001
          description: >-
            A vehicle identifier that will make sense to the dispatcher and the
            customer
        vehicleExternalId:
          type: string
          example: T001
          description: >-
            A vehicle external identifier that will make sense to the dispatcher
            and the customer
        registration:
          type: string
          example: ABC123
          description: Vehicle registration
        reference:
          type: string
          example: docket 123
          description: Carrier reference field
    ActivityExceptionFlag:
      type: object
      required:
        - timestamp
        - flagReason
      properties:
        timestamp:
          type: string
          format: date-time
          description: RFC3339 time of the event
        flagReason:
          type: string
          example: Unable to deliver to port
          description: The exception reason
    VehicleAssignment:
      type: object
      required:
        - timestamp
        - vehicleId
      properties:
        timestamp:
          type: string
          format: date-time
          description: RFC3339 time of the event
        contact:
          allOf:
            - $ref: '#/components/schemas/ContactDetails'
            - description: Dispatcher contact details
        registration:
          type: string
          example: ABC123
        vehicleId:
          type: string
          example: T001
          description: >-
            A vehicle identifier that will make sense to the dispatcher and the
            customer
        vehicleExternalId:
          type: string
          example: T001
          description: >-
            A vehicle external identifier that will make sense to the dispatcher
            and the customer
        quantity:
          type: number
          description: Quantity of product allotted to this vehicle for the booking
        massKg:
          type: number
          description: >-
            Weight of product allotted to this vehicle for the booking if
            quantity does not imply it
        netWeightKg:
          type: number
          description: >-
            The net weight of the product allotted to this vehicle for the
            booking
        tareWeightKg:
          type: number
          description: >-
            The tare weight of the product allotted to this vehicle for the
            booking
        spatialRequirements:
          type: number
          description: >-
            Could represent many dimensions, cube for bulk, area for livestock
            etc if quantity does not imply it
        reference:
          type: string
          example: ABC123
    TimeWindow:
      type: object
      description: Estimated arrival time window
      required:
        - start
        - end
      properties:
        start:
          type: string
          format: date-time
          description: RFC3339 start of the window
        end:
          type: string
          format: date-time
          description: RFC3339 end of the window
    ProofOfDelivery:
      type: object
      properties:
        signedBy:
          type:
            - string
            - 'null'
          description: Name of person signing (accepting responsibility)
          example: John Doe
          default: null
        completedBy:
          type:
            - object
            - 'null'
          description: User that carried out this operation, e.g. Driver
          default: null
          properties:
            id:
              type: string
              description: >-
                The external user identifier for driver/device if set, otherwise
                the M2X internal userId
            name:
              type:
                - string
                - 'null'
              description: Human readable name of user, e.g. Driver's name
              default: null
        downloadUrl:
          type:
            - string
            - 'null'
          description: URL where proof of delivery PDF can be downloaded from
          example: >-
            https://m2x.app/apis/v0/resources/generalConsignments/TGX854-6OU9Ns9xm9E4JxP1YJYs-1670743772224/pod/pdf
          format: uri
    SLA:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/SLAStatus'
        slaOverTime:
          type: array
          items:
            type: object
            properties:
              key:
                type: number
              status:
                $ref: '#/components/schemas/SLAStatus'
              title:
                type: string
        slaDelaySplits:
          type: array
          items:
            $ref: '#/components/schemas/SLADelay'
    SLASubStatus:
      type: object
      properties:
        jobs:
          type: number
        quantity:
          type: number
        weightKg:
          type: number
    SLADelay:
      type: object
      anyOf:
        - $ref: '#/components/schemas/HourlyDelaySplits'
        - $ref: '#/components/schemas/DailyDelaySplits'
    HourlyDelaySplits:
      properties:
        key:
          type: string
          enum:
            - '*-0.0'
            - 0.0-3600.0
            - 3600.0-7200.0
            - 7200.0-10800.0
            - 10800.0-*
            - noDelivery
        name:
          type: string
          enum:
            - On Time
            - 1+ Hours Late
            - 2+ Hours Late
            - 3+ Hours Late
            - 4+ Hours Late
            - No Delivery
        from:
          type: number
        to:
          type: number
        totalJobs:
          type: number
        totalQuantity:
          type: number
        totalWeightKg:
          type: number
    DailyDelaySplits:
      properties:
        key:
          type: string
          enum:
            - '*-0.0'
            - 0.0-86400.0
            - 86400.0-172800.0
            - 172800.0-259200.0
            - 259200.0-*
            - noDelivery
        name:
          type: string
          enum:
            - On Time
            - 1+ Days Late
            - 2+ Days Late
            - 3+ Days Late
            - 4+ Days Late
            - No Delivery
        from:
          type: number
        to:
          type: number
        totalJobs:
          type: number
        totalQuantity:
          type: number
        totalWeightKg:
          type: number
    SLAStatus:
      type: object
      properties:
        breached:
          $ref: '#/components/schemas/SLASubStatus'
        none:
          $ref: '#/components/schemas/SLASubStatus'
        respected:
          $ref: '#/components/schemas/SLASubStatus'
        totalJobs:
          type: number
        totalQuantity:
          type: number
        totalWeightKg:
          type: number
    SLARequestGroup:
      type: object
      properties:
        type:
          type: string
          enum:
            - region
            - district
            - location
            - locationGroup
        deliveries:
          type: boolean
        pickups:
          type: boolean
        ids:
          type: array
          items:
            type: string
    SLARequest:
      type: object
      required:
        - start
        - end
      properties:
        start:
          type: string
          description: RFC3339 start of the window
          format: date-time
          example: '2021-01-01T12:00:00.000Z'
        end:
          type: string
          description: RFC3339 end of the window
          format: date-time
          example: '2021-06-30T11:59:59.999Z'
        fromType:
          type: string
          description: From type
          example: locationGroup
          enum:
            - region
            - district
            - location
            - locationGroup
        endType:
          type: string
          description: End type
          enum:
            - region
            - district
            - location
            - locationGroup
          example: locationGroup
        fromId:
          type:
            - string
            - 'null'
          description: Id of the pickup grouping entity,
          default: null
        endId:
          type:
            - string
            - 'null'
          description: Id of the delivery grouping entity
          default: null
        groups:
          type: array
          description: Grouping entities
          items:
            $ref: '#/components/schemas/SLARequestGroup'
          default: []
        productCodeIds:
          type: array
          description: Product code ids
          items:
            type: string
            description: Product Code ID
          default: []
        productTypes:
          type: array
          description: Product types
          items:
            type: string
            description: Product type, eg., "Livestock"
            example: Livestock
          default: []
        type:
          type: string
          description: Type of delay analysis, eg. daily, hourly
          default: daily
          enum:
            - daily
            - hourly
    CarrierProductMappingRequest:
      type: object
      description: Parameters to try to map a product with M2X
      properties:
        productCodeName:
          type: string
        productCodeId:
          type: string
        integrationId:
          type: string
    CarrierContentMappingRequest:
      type:
        - object
        - 'null'
      description: Specific information about the content carted
      default: null
      properties:
        description:
          type: string
          description: Description of the payload
        productBundle:
          type: object
          description: Details of the products carted
          properties:
            payload:
              type: array
              items:
                type: object
                properties:
                  itemId:
                    type: string
                  quantity:
                    type: number
                    description: This item quantity
                  description:
                    type: string
                  massKg:
                    type: number
                    description: Optional override for the weight
                  spatialRequirement:
                    type: number
                    description: Optional override for the volume
                  unitOfMeasure:
                    type: string
                    description: Optional unit of measure (e.g. bags)
                  product:
                    $ref: '#/components/schemas/CarrierProductMappingRequest'
                  metadata:
                    $ref: '#/components/schemas/Metadata'
                  properties:
                    $ref: '#/components/schemas/CustomProperties'
    CarrierCustomerMappingRequest:
      type: object
      description: Parameters to try to map a customer with M2X
      properties:
        customerName:
          type: string
          example: Fruit World
        customerId:
          type: string
          example: Yc7cXUulBhMM58iuOQce
        externalId:
          type: string
          example: FTW
        integrationId:
          type: string
          example: C99
    CarrierBranchMappingRequest:
      type: object
      description: Parameters to try to map a branch with M2X
      properties:
        branchId:
          type:
            - string
            - 'null'
        externalId:
          type:
            - string
            - 'null'
        branchName:
          type:
            - string
            - 'null'
    CarrierLocationMappingRequest:
      type: object
      description: Parameters to try to map a location with M2X
      properties:
        locationId:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the location code used
          example: C6mruxd3AVUTW14vEZ0v
          default: null
        addressText:
          type:
            - string
            - 'null'
          description: >-
            Address, if present and no locationId or external Id is matching,
            will try to geocode
          example: 123 Example Road, Auckland 1010
          default: null
        externalId:
          type:
            - string
            - 'null'
          description: External Id
          example: WHC6
          default: null
        locationName:
          type:
            - string
            - 'null'
          description: >-
            Helps user creating the missing mapping upon mapping failure, or
            used to save location if new
          example: Auckland Storage 1
          default: null
        latitude:
          type: number
          example: -36.983882
          default: 0
        longitude:
          type: number
          example: 174.709879
          default: 0
        locationNameResolutionEnabled:
          type: boolean
          description: >-
            Try to resolve location by name, quick weak method, disabled by
            default
          default: false
        saveIfUnknown:
          type: boolean
          description: >-
            If no existing location is found, locationId provided and lat/lng
            provided or geocode successful, will create location
          default: false
    CarrierTankMappingRequest:
      type: object
      description: >-
        Parameters to try to map a tank with M2X, in the scope of the location
        try by integration id then by name then product
      properties:
        tankName:
          type: string
        tankId:
          type: string
          description: M2X internal tank id
        integrationId:
          type: string
        product:
          $ref: '#/components/schemas/CarrierProductMappingRequest'
        quantity:
          type: number
          description: The product quantity
          default: 0
    RunsActivity:
      type: object
      properties:
        id:
          type: string
          example: D001
        departureTime:
          type:
            - string
            - 'null'
          format: date-time
        arrivalTime:
          type:
            - string
            - 'null'
          format: date-time
        deleted:
          type: boolean
        type:
          type: string
          enum:
            - pickup
            - delivery
            - start
            - end
        constraintId:
          type:
            - string
            - 'null'
          example: D001
        dispatchGroupId:
          type:
            - string
            - 'null'
          example: ABC1123-asdasdasd-123213
        vehicleId:
          type: string
          example: D001
        location:
          $ref: '#/components/schemas/JobLocation'
        product:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/DynamicFulfilmentProduct'
        productComponents:
          type:
            - array
            - 'null'
          description: The sub components of the product if present
          items:
            $ref: '#/components/schemas/ProductComponent'
        productSpatialRequirement:
          type:
            - number
            - 'null'
        totalProductSpatialRequirement:
          type:
            - number
            - 'null'
        shiftMetadata:
          $ref: '#/components/schemas/ShiftMetadata'
        actual:
          type:
            - object
            - 'null'
          properties:
            vehicleId:
              type: string
              example: D001
            truckReference:
              type: string
              example: D001
            timestamp:
              type: string
              format: date-time
            bolLoadingReferences:
              anyOf:
                - $ref: '#/components/schemas/DynamicFulfilmentBolAssetReferences'
            attachments:
              type: array
              items:
                $ref: '#/components/schemas/CarrierAttachment'
            product:
              anyOf:
                - $ref: '#/components/schemas/DynamicFulfilmentProduct'
                - type: 'null'
            productComponents:
              type:
                - array
                - 'null'
              description: The sub components of the product if present
              items:
                $ref: '#/components/schemas/ProductComponent'
            actualType:
              anyOf:
                - type: 'null'
                - type: string
                  enum:
                    - DOCKET
                    - DRIVER
                    - OFFICE
                    - PARTIAL_OFFICE
            productSpatialRequirement:
              type:
                - number
                - 'null'
        timeConstraint:
          anyOf:
            - $ref: '#/components/schemas/ActivityTimeConstraint'
            - type: 'null'
        firstPublishedState:
          description: >-
            Details about the activity as it was when it was published for the
            first time
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentActivityPublishedState'
            - type: 'null'
    ActivityTimeConstraint:
      type: object
      properties:
        type:
          type: string
          enum:
            - NO_LATER_THAN
            - NOT_EARLIER_THAN
            - SPECIFIC_TIME
            - INTERVAL
        time:
          type:
            - string
            - 'null'
          description: >-
            24h time, only required if type is NO_LATER_THAN, NOT_EARLIER_THAN
            or SPECIFIC_TIME
          example: '11:52'
        start:
          type:
            - string
            - 'null'
          description: 24h time, only required if type is INTERVAL
          example: '11:52'
        end:
          type:
            - string
            - 'null'
          description: 24h time, only required if type is INTERVAL
          example: '14:52'
      required:
        - type
    DynamicFulfilmentActivityPublishedState:
      type: object
      properties:
        arrivalTime:
          type:
            - string
            - 'null'
          format: date-time
        departureTime:
          type:
            - string
            - 'null'
          format: date-time
        dispatchGroupId:
          type:
            - string
            - 'null'
        vehicleId:
          type: string
      required:
        - vehicleId
    RunsActivities:
      type: array
      items:
        $ref: '#/components/schemas/RunsActivity'
    RunPickupRequest:
      type: object
      required:
        - customer
        - location
        - product
        - quantity
      properties:
        customer:
          $ref: '#/components/schemas/CarrierCustomerMappingRequest'
        location:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        content:
          $ref: '#/components/schemas/CarrierContentMappingRequest'
        product:
          $ref: '#/components/schemas/CarrierProductMappingRequest'
        quantity:
          type: number
        externalId:
          type: number
        priority:
          $ref: '#/components/schemas/DynamicFulfilmentActivityPriority'
        orderDay:
          $ref: '#/components/schemas/DynamicFulfilmentOrderDay'
        readonlyFields:
          type: object
          description: Specifies which field should not be touched by the user
          properties:
            deleted:
              type: boolean
              default: false
            customer:
              type: boolean
              default: false
            location:
              type: boolean
              default: false
            content:
              type: boolean
              default: false
            product:
              type: boolean
              default: false
            quantity:
              type: boolean
              default: false
            priority:
              type: boolean
              default: false
            properties:
              type: boolean
              default: false
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
    FuelDeliveryRequestResolved:
      type: object
      properties:
        id:
          type: string
        externalId:
          anyOf:
            - type: string
            - type: 'null'
        priority:
          $ref: '#/components/schemas/DynamicFulfilmentActivityPriority'
        orderDay:
          $ref: '#/components/schemas/DynamicFulfilmentOrderDay'
        targetDate:
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentTargetDate'
            - type: 'null'
        shortNote:
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentShortNote'
            - type: 'null'
        officeNotes:
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentOfficeNotes'
            - type: 'null'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        location:
          $ref: '#/components/schemas/JobLocation'
        tanks:
          type: array
          items:
            type: object
            properties:
              storageId:
                anyOf:
                  - type: string
                  - type: 'null'
              storageName:
                anyOf:
                  - type: string
                  - type: 'null'
              storageIntegrationId:
                anyOf:
                  - type: string
                  - type: 'null'
              product:
                $ref: '#/components/schemas/DynamicFulfilmentProduct'
    FuelDeliveryRequestBulkTank:
      type: object
      required:
        - customer
        - location
        - tanks
      properties:
        customer:
          $ref: '#/components/schemas/CarrierCustomerMappingRequest'
        location:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        tanks:
          type: array
          items:
            $ref: '#/components/schemas/CarrierTankMappingRequest'
        externalId:
          type: string
        priority:
          $ref: '#/components/schemas/DynamicFulfilmentActivityPriority'
        orderDay:
          $ref: '#/components/schemas/DynamicFulfilmentOrderDay'
        targetDate:
          $ref: '#/components/schemas/DynamicFulfilmentTargetDate'
        shortNote:
          $ref: '#/components/schemas/DynamicFulfilmentShortNote'
        officeNotes:
          $ref: '#/components/schemas/DynamicFulfilmentOfficeNotes'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        readonlyFields:
          type:
            - object
            - 'null'
          description: Specifies which field should not be touched by the user
          properties:
            deleted:
              type: boolean
              default: false
            customer:
              type: boolean
              default: false
            location:
              type: boolean
              default: false
            priority:
              type: boolean
              default: false
            properties:
              type: boolean
              default: false
        associationConstraints:
          type: array
          items:
            $ref: '#/components/schemas/AssociationConstraint'
    FuelDeliveryRequest:
      $ref: '#/components/schemas/FuelDeliveryRequestBulkTank'
    FuelDeliveryRequestBulkTankless:
      type: object
      required:
        - customer
        - location
        - content
      properties:
        customer:
          $ref: '#/components/schemas/CarrierCustomerMappingRequest'
        location:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        content:
          $ref: '#/components/schemas/CarrierContentMappingRequest'
        externalId:
          type: string
        priority:
          $ref: '#/components/schemas/DynamicFulfilmentActivityPriority'
        orderDay:
          $ref: '#/components/schemas/DynamicFulfilmentOrderDay'
        targetDate:
          $ref: '#/components/schemas/DynamicFulfilmentTargetDate'
        shortNote:
          $ref: '#/components/schemas/DynamicFulfilmentShortNote'
        officeNotes:
          $ref: '#/components/schemas/DynamicFulfilmentOfficeNotes'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        readonlyFields:
          type:
            - object
            - 'null'
          description: Specifies which field should not be touched by the user
          properties:
            deleted:
              type: boolean
              default: false
            customer:
              type: boolean
              default: false
            location:
              type: boolean
              default: false
            content:
              type: boolean
              default: false
            contentItemAdd:
              type: boolean
              default: false
            contentItemRemove:
              type: boolean
              default: false
            contentItemProduct:
              type: boolean
              default: false
            contentItemQuantity:
              type: boolean
              default: false
            contentItemDescription:
              type: boolean
              default: false
            product:
              type: boolean
              default: false
            quantity:
              type: boolean
              default: false
            priority:
              type: boolean
              default: false
            properties:
              type: boolean
              default: false
        associationConstraints:
          type: array
          items:
            $ref: '#/components/schemas/AssociationConstraint'
    FuelPackagedDeliveryRequestResolved:
      type: object
      properties:
        id:
          type: string
        externalId:
          anyOf:
            - type: string
            - type: 'null'
        priority:
          $ref: '#/components/schemas/DynamicFulfilmentActivityPriority'
        orderDay:
          $ref: '#/components/schemas/DynamicFulfilmentOrderDay'
        targetDate:
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentTargetDate'
            - type: 'null'
        shortNote:
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentShortNote'
            - type: 'null'
        officeNotes:
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentOfficeNotes'
            - type: 'null'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        location:
          $ref: '#/components/schemas/JobLocation'
        content:
          $ref: '#/components/schemas/Content'
    FuelBulkTanklessDeliveryRequestResolved:
      type: object
      properties:
        id:
          type: string
        externalId:
          anyOf:
            - type: string
            - type: 'null'
        priority:
          $ref: '#/components/schemas/DynamicFulfilmentActivityPriority'
        orderDay:
          $ref: '#/components/schemas/DynamicFulfilmentOrderDay'
        targetDate:
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentTargetDate'
            - type: 'null'
        shortNote:
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentShortNote'
            - type: 'null'
        officeNotes:
          anyOf:
            - $ref: '#/components/schemas/DynamicFulfilmentOfficeNotes'
            - type: 'null'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        location:
          $ref: '#/components/schemas/JobLocation'
        content:
          $ref: '#/components/schemas/Content'
    FuelPackagedDeliveryRequest:
      type: object
      required:
        - customer
        - location
        - content
      properties:
        customer:
          $ref: '#/components/schemas/CarrierCustomerMappingRequest'
        location:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        content:
          $ref: '#/components/schemas/CarrierContentMappingRequest'
        externalId:
          type: string
        priority:
          $ref: '#/components/schemas/DynamicFulfilmentActivityPriority'
        orderDay:
          $ref: '#/components/schemas/DynamicFulfilmentOrderDay'
        targetDate:
          $ref: '#/components/schemas/DynamicFulfilmentTargetDate'
        shortNote:
          $ref: '#/components/schemas/DynamicFulfilmentShortNote'
        officeNotes:
          $ref: '#/components/schemas/DynamicFulfilmentOfficeNotes'
        properties:
          $ref: '#/components/schemas/CustomProperties'
        metadata:
          $ref: '#/components/schemas/Metadata'
        readonlyFields:
          type:
            - object
            - 'null'
          description: Specifies which field should not be touched by the user
          properties:
            deleted:
              type: boolean
              default: false
            customer:
              type: boolean
              default: false
            location:
              type: boolean
              default: false
            content:
              type: boolean
              default: false
            contentItemAdd:
              type: boolean
              default: false
            contentItemRemove:
              type: boolean
              default: false
            contentItemProduct:
              type: boolean
              default: false
            contentItemQuantity:
              type: boolean
              default: false
            contentItemDescription:
              type: boolean
              default: false
            product:
              type: boolean
              default: false
            quantity:
              type: boolean
              default: false
            priority:
              type: boolean
              default: false
            properties:
              type: boolean
              default: false
        associationConstraints:
          type: array
          items:
            $ref: '#/components/schemas/AssociationConstraint'
    RunMeasurementRequest:
      $ref: '#/components/schemas/RunMeasurementBase'
    RunMeasurement:
      allOf:
        - $ref: '#/components/schemas/RunMeasurementBase'
        - type: object
          properties:
            updated:
              type: string
              format: date-time
            measurementId:
              type: string
    RunMeasurementBase:
      type: object
      required:
        - locationExternalId
        - locationName
        - startTime
        - endTime
        - productQuantity
        - truckName
      properties:
        locationExternalId:
          type: string
        locationName:
          type: string
        toLocationExternalId:
          type: string
        toLocationName:
          type: string
        truckName:
          type: string
        truckExternalId:
          type: string
        driverName:
          type: string
        driverExternalId:
          type: string
        customerName:
          type: string
        serviceDay:
          type: string
          format: date
          description: The day the pickup belongs to in case of after midnight
        startTime:
          type: string
          format: date-time
        endTime:
          type: string
          format: date-time
        productQuantity:
          type: number
        customerRunNumber:
          type: string
        internalRunNumber:
          type: string
        properties:
          type: object
          additionalProperties: true
        metadata:
          type: object
          additionalProperties: true
        measurements:
          type: object
          properties:
            temperature:
              type: number
            minTemperature:
              type: number
            maxTemperature:
              type: number
    WeighbridgeMeasurement:
      type: object
      properties:
        unit:
          type: string
          enum:
            - kilogram
            - tonne
            - pound
            - ton
          description: What unit the weight values are in
        netWeight:
          type: number
          description: The net weight of the contents of the truck
        grossWeight:
          type: number
          description: The gross weight of the contents of the truck
        tareWeight:
          type: number
          description: The tare weight of the contents of the truck
        timestamp:
          type: number
          description: The timestamp that the measurement took place in Unix time
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Opaque weighbridge key-value measurement data
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: >-
            Optional weighbridge key-value measurement properties that may be
            used in eDockets
      required:
        - unit
        - netWeight
      additionalProperties: false
    ConsignmentProperties:
      type: object
      properties:
        serviceCode:
          type: string
          description: Nature of work, e.g. G = general, WH = warehouse, C = container
          example: WH
          enum:
            - C
            - G
            - R
            - W
            - WH
        dangerousGoods:
          type: boolean
        noCharge:
          type: boolean
          description: Indicate internal work that should not be invoiced
          default: false
        loadShare:
          type: boolean
          description: Indicate consignment qualifies for load share rating
          default: false
      required:
        - serviceCode
        - dangerousGoods
    GeneralConsignment:
      type: object
      properties:
        consignmentGroupId:
          type: string
          description: Internal M2X consignment group id
          example: yMnAFBBcNA4VQ8NjaJYz
        groupReference:
          type:
            - string
            - 'null'
          description: Optional reference label for the consignment group
          example: GRP0091892
        consignmentId:
          type: string
          description: Internal M2X consignment id
          example: TGX854-6OU9Ns9xm9E4JxP1YJYs-1670743772224
        consignmentIntegrationId:
          type:
            - string
            - 'null'
          description: External consignment integration id
          example: TIMB/000001/IN
        consignmentReference:
          type:
            - string
            - 'null'
          description: Optional reference label for the consignment
          example: C002901092
        customerId:
          type:
            - string
            - 'null'
          description: The M2X customer id for this job
          example: Yc7cXUulBhMM58iuOQce
        customerExternalId:
          type:
            - string
            - 'null'
          description: External customer id for this job
          example: FTW
        customerIntegrationId:
          type:
            - string
            - 'null'
          description: Customer integration id for this job
          example: C99
        customerName:
          type:
            - string
            - 'null'
          description: Customer name for this job
          example: Fruit World
        status:
          type: string
          description: Current consignment status
          enum:
            - Booked
            - Started
            - Delivered
            - Accepted
            - Invoiced
        properties:
          $ref: '#/components/schemas/ConsignmentProperties'
        transportNote:
          type:
            - string
            - 'null'
          description: Any additional human readable detail to be supplied with consignment
          example: Call Bob to confirm
        content:
          type: object
          description: Specific information about the content carted
          properties:
            payload:
              type: array
              items:
                type: object
                properties:
                  productCode:
                    type: string
                    description: Internal M2X product code id
                    example: Z5BFB6nUToADamO7M01G
                  productCodeExternalId:
                    type:
                      - string
                      - 'null'
                    description: External product code id
                    example: FERT
                  productCodeName:
                    type: string
                    description: Human readable product code name
                    example: Bagged Fertiliser
                  description:
                    type:
                      - string
                      - 'null'
                    description: Additional detail about the product
                    example: BB SKU00390029 25kg
                  measures:
                    type: object
                    properties:
                      items:
                        type: number
                        example: 10
                        description: >-
                          Primary quantity (meaning is dependent on product
                          code)
                        minimum: 0
                      pltOrBin:
                        type:
                          - integer
                          - 'null'
                        example: 10
                        description: >-
                          Number of pallets or bin (omit or null if not
                          available)
                        minimum: 0
                      lift:
                        type:
                          - number
                          - 'null'
                        example: 3.78
                        description: lift (omit or null if not available)
                        minimum: 0
                      volume:
                        type:
                          - number
                          - 'null'
                        example: 12.58
                        description: Cube m³ (omit or null if not available)
                        minimum: 0
                      mass:
                        type:
                          - integer
                          - 'null'
                        example: 8500
                        description: kg (omit or null if not available)
                        minimum: 0
                    required:
                      - items
                required:
                  - productCode
                  - productCodeExternalId
                  - productCodeName
                  - description
                  - measures
              minItems: 1
          required:
            - payload
        senderReference:
          type:
            - string
            - 'null'
          description: Optional additional reference label
          example: S49029
        fromLocation:
          $ref: '#/components/schemas/Location'
        fromDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        fromRegion:
          type:
            - string
            - 'null'
          description: Dispatch region
          example: BOP
        receiverReference:
          type:
            - string
            - 'null'
          description: Optional additional reference label
          example: R04746
        toLocation:
          $ref: '#/components/schemas/Location'
        toDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        toRegion:
          type:
            - string
            - 'null'
          description: Dispatch region
          example: AKL
        pod:
          type:
            - object
            - 'null'
          properties:
            delivery:
              $ref: '#/components/schemas/ProofOfDelivery'
          required:
            - delivery
        metadata:
          type:
            - object
            - 'null'
          description: Opaque passenger data
          additionalProperties: true
        deleted:
          type: boolean
          description: True if the consignment is deleted
        pickupTimestamp:
          type:
            - string
            - 'null'
          format: date-time
          description: RFC3339 date time of pickup (actual)
        deliveryTimestamp:
          type:
            - string
            - 'null'
          format: date-time
          description: RFC3339 date time of delivery (actual)
        expense:
          type:
            - number
            - 'null'
          description: Total expense for the consignment
        expenseFaf:
          type:
            - number
            - 'null'
          description: Fuel Adjustment Factor applied to the consignment expenses
        revenue:
          type:
            - number
            - 'null'
          description: Total revenue for the consignment
        revenueFaf:
          type:
            - number
            - 'null'
          description: Fuel Adjustment Factor applied to the consignment revenue
        created:
          type:
            - string
            - 'null'
          format: date-time
          description: RFC3339 date time
        legs:
          type:
            - array
            - 'null'
          description: Consignment leg details
          items:
            type: object
            properties:
              legNumber:
                type: number
                description: The sequence number of the leg
              status:
                type:
                  - string
                  - 'null'
                enum:
                  - Booked
                  - Declined
                  - Started
                  - Delivered
                  - null
              type:
                type:
                  - string
                  - 'null'
                enum:
                  - Linehaul
                  - Single
                  - Pickup
                  - Delivery
                  - Unlabeled
                  - null
              distanceKm:
                type:
                  - number
                  - 'null'
              revenue:
                type:
                  - number
                  - 'null'
                description: Total revenue to the leg
              expense:
                type:
                  - number
                  - 'null'
                description: Total expense allocated to the leg
              deliveryDriver:
                type:
                  - string
                  - 'null'
                description: Name of the driver who completed the delivery
              deliveredBy:
                type:
                  - string
                  - 'null'
                enum:
                  - DriverMobile
                  - Admin
                  - null
              signedOnGlassDelivery:
                type: boolean
                description: Whether or not a signature was obtained on delivery
              plannedPickupDate:
                type: string
                format: date
                description: Planned pickup date for the leg (YYYY-MM-DD)
              pickupTimestamp:
                type:
                  - string
                  - 'null'
                format: date-time
                description: RFC3339 date time of delivery (actual)
              deliveryTimestamp:
                type:
                  - string
                  - 'null'
                format: date-time
                description: RFC3339 date time of delivery (actual)
              vehicleName:
                type:
                  - string
                  - 'null'
              manifestNumber:
                type:
                  - number
                  - 'null'
              fromLocation:
                $ref: '#/components/schemas/Location'
              fromRegion:
                type:
                  - string
                  - 'null'
                description: Dispatch region
                example: AKL
              toLocation:
                $ref: '#/components/schemas/Location'
              toRegion:
                type:
                  - string
                  - 'null'
                description: Dispatch region
                example: AKL
            required:
              - legNumber
      required:
        - consignmentGroupId
        - groupReference
        - consignmentId
        - consignmentReference
        - status
        - properties
        - content
        - fromDateAndTimeConstraint
        - toDateAndTimeConstraint
        - pod
    GeneralConsignmentRequest:
      type: object
      properties:
        integrationId:
          type: string
          description: External consignment identifier
        consignmentReference:
          type:
            - string
            - 'null'
          description: Optional reference label for the consignment
          example: C002901092
        properties:
          $ref: '#/components/schemas/ConsignmentProperties'
        transportNote:
          type:
            - string
            - 'null'
          description: Any additional human readable detail to be supplied with consignment
          example: Call Bob to confirm
        senderReference:
          type:
            - string
            - 'null'
          description: Optional additional reference label
          example: S49029
        fromDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        receiverReference:
          type:
            - string
            - 'null'
          description: Optional additional reference label
          example: R04746
        toDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        metadata:
          type:
            - object
            - 'null'
          description: Opaque passenger data
          additionalProperties: true
      required:
        - integrationId
        - consignmentReference
        - properties
        - fromDateAndTimeConstraint
        - toDateAndTimeConstraint
    GeneralConsignmentRequestMappingRequest:
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/CarrierCustomerMappingRequest'
        fromLocation:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        toLocation:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        content:
          type: object
          description: Specific information about the content carted
          properties:
            payload:
              type: array
              items:
                type: object
                properties:
                  description:
                    type:
                      - string
                      - 'null'
                    description: Additional detail about the product
                    example: BB SKU00390029 25kg
                  measures:
                    type: object
                    properties:
                      items:
                        type: number
                        example: 10
                        description: >-
                          Primary quantity (meaning is dependent on product
                          code)
                        minimum: 0
                      pltOrBin:
                        type:
                          - integer
                          - 'null'
                        example: 10
                        description: >-
                          Number of pallets or bin (omit or null if not
                          available)
                        minimum: 0
                      lift:
                        type:
                          - number
                          - 'null'
                        example: 3.78
                        description: lift (omit or null if not available)
                        minimum: 0
                      volume:
                        type:
                          - number
                          - 'null'
                        example: 12.58
                        description: Cube m³ (omit or null if not available)
                        minimum: 0
                      mass:
                        type:
                          - integer
                          - 'null'
                        example: 8500
                        description: kg (omit or null if not available)
                        minimum: 0
                    required:
                      - items
                  product:
                    type: object
                    description: Parameters to try to map a product with M2X
                    properties:
                      productCode:
                        type:
                          - string
                          - 'null'
                        description: Internal M2X product code id
                        example: Z5BFB6nUToADamO7M01G
                        default: null
                      productCodeExternalId:
                        type:
                          - string
                          - 'null'
                        description: External product code integration id
                        example: FERT
                        default: null
                      productDescription:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Helps user creating the missing mapping upon mapping
                          failure
                        example: Palletized fertiliser bags (10kg)
                        default: null
                required:
                  - measures
                  - product
              minItems: 1
          required:
            - payload
      required:
        - customer
        - fromLocation
        - toLocation
        - content
    CarrierLargeContract:
      type: object
      properties:
        contractId:
          type: string
        externalId:
          type:
            - string
            - 'null'
        bookingId:
          type:
            - string
            - 'null'
        customerBookingId:
          type:
            - string
            - 'null'
        branches:
          type: array
          items:
            $ref: '#/components/schemas/Branch'
        created:
          type:
            - string
            - 'null'
          format: date-time
        updated:
          type:
            - string
            - 'null'
          format: date-time
        customerId:
          type: string
          description: Carrier customer id for this contract
        customerName:
          type: string
          description: Carrier customer name for this contract
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: M2X name for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        productComponents:
          anyOf:
            - type: 'null'
            - type: array
              description: The sub components of the product if present
              items:
                $ref: '#/components/schemas/ProductComponent'
          default: null
        properties:
          type:
            - object
            - 'null'
          description: A key value store containing custom properties
          default: null
        quantity:
          type: number
          description: The product quantity
          default: 0
        fromLocation:
          $ref: '#/components/schemas/Location'
        fromTimeConstraint:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimeConstraint'
        toLocation:
          $ref: '#/components/schemas/Location'
        toTimeConstraint:
          anyOf:
            - type: 'null'
            - $ref: '#/components/schemas/TimeConstraint'
        noteLong:
          type:
            - string
            - 'null'
          description: Long note
        noteShort:
          type:
            - string
            - 'null'
          description: Short note
        priceTotal:
          type:
            - number
            - 'null'
          description: >-
            Total transport price. Use priceTotal OR pricePerUnit +
            priceUnitOfMeasure
        pricePerUnit:
          type:
            - number
            - 'null'
          description: Transport price per unit
        priceUnitOfMeasure:
          type:
            - string
            - 'null'
          description: >-
            Unit of measure used for transport pricing e.g. metric values ea, t,
            kg, m3, km and imperial values ea, tn, cwt, lb, ft3, mi
        adjustmentPriceTotal:
          type:
            - number
            - 'null'
          description: >-
            Total adjustment price when specifying a fixed price. Use
            adjustmentPriceTotal OR adjustmentPricePerUnit +
            adjustmentPriceUnitOfMeasure
        adjustmentPricePerUnit:
          type:
            - number
            - 'null'
          description: Price per unit
        adjustmentPriceUnitOfMeasure:
          type:
            - string
            - 'null'
          description: >-
            Unit of measure used for adjustment pricing e.g. no value allows
            adjustmentPricePerUnit to be specified as a decimal percentage of
            transport total price, metric values t, kg, km and imperial values
            tn, cwt, lb, mi
        transportPricePerUnit:
          type:
            - number
            - 'null'
          description: Transport price per unit
        validFromDate:
          type:
            - string
            - 'null'
          format: date
          description: The date this contract is valid from
        requiredByDate:
          type:
            - string
            - 'null'
          format: date
          description: The date this contract needs to be completed by
        completed:
          type: boolean
          description: True if the contract has been completed
        draft:
          type: boolean
          description: True if the contract is a draft
    AssociationConstraintOperationType:
      type: string
      enum:
        - LOADING
        - UNLOADING
        - ACCESS
        - CARGO_MOVEMENT
      description: Type of operation for transport request association constraints
    AssociationConstraintConditionType:
      type: string
      enum:
        - REQUIRE
        - FORBID
      description: Type of condition for transport request association constraints
    AssociationConstraintEntityType:
      type: string
      enum:
        - VEHICLE
        - DRIVER
        - TRAILER
        - TRACTOR_UNIT
        - LOCATION
        - COMPARTMENT
      description: Type of entity for transport request association constraints
    AssociationConstraint:
      type: object
      required:
        - operation
        - entities
        - conditionType
        - constraintLabelId
      properties:
        operation:
          $ref: '#/components/schemas/AssociationConstraintOperationType'
          description: The type of operation to be constrained
        entities:
          type: array
          items:
            $ref: '#/components/schemas/AssociationConstraintEntityType'
          description: List of entity types to be considered when evaluating the constraint
        conditionType:
          $ref: '#/components/schemas/AssociationConstraintConditionType'
          description: >-
            Whether this constraint requires or forbids entities that possess
            the constraint label
        constraintLabelId:
          type: string
          description: Identifier for the constraint label
    CarrierLargeContractRequest:
      type: object
      properties:
        contractId:
          type: string
        externalId:
          type: string
        bookingId:
          type: string
        customerBookingId:
          type: string
        quantity:
          type: number
          description: The product quantity
          default: 0
        properties:
          type:
            - object
            - 'null'
          description: A key value store containing custom properties
          default: null
        fromTimeConstraint:
          $ref: '#/components/schemas/TimeConstraint'
        toTimeConstraint:
          $ref: '#/components/schemas/TimeConstraint'
        noteLong:
          type: string
          description: Long note
        noteShort:
          type: string
          description: Short note
        priceTotal:
          type:
            - number
            - 'null'
          description: >-
            Total transport price. Use priceTotal OR pricePerUnit +
            priceUnitOfMeasure
          default: null
        pricePerUnit:
          type:
            - number
            - 'null'
          description: Transport price per unit
          default: null
        priceUnitOfMeasure:
          type:
            - string
            - 'null'
          description: >-
            Unit of measure used for transport pricing e.g. metric values ea, t,
            kg, m3, km and imperial values ea, tn, cwt, lb, ft3, mi
          default: null
        adjustmentPriceTotal:
          type:
            - number
            - 'null'
          description: >-
            Total adjustment price when specifying a fixed price. Use
            adjustmentPriceTotal OR adjustmentPricePerUnit +
            adjustmentPriceUnitOfMeasure
          default: null
        adjustmentPricePerUnit:
          type:
            - number
            - 'null'
          description: Price per unit
          default: null
        adjustmentPriceUnitOfMeasure:
          type:
            - string
            - 'null'
          description: >-
            Unit of measure used for adjustment pricing e.g. no value allows
            adjustmentPricePerUnit to be specified as a decimal percentage of
            transport total price, metric values t, kg, km and imperial values
            tn, cwt, lb, mi
          default: null
        transportPricePerUnit:
          type: number
          description: Transport price per unit
        validFromDate:
          type: string
          format: date
          description: The date this contract is valid from
        requiredByDate:
          type: string
          format: date
          description: The date this contract needs to be completed by
        draft:
          type: boolean
          description: True if the contract is a draft
          default: false
        readonlyFields:
          type: object
          description: Specifies which field should not be touched by the user
          properties:
            externalId:
              type: boolean
              default: false
            customer:
              type: boolean
              default: false
            product:
              type: boolean
              default: false
            quantity:
              type: boolean
              default: false
            fromLocation:
              type: boolean
              default: false
            fromTimeConstraint:
              type: boolean
              default: false
            toLocation:
              type: boolean
              default: false
            toTimeConstraint:
              type: boolean
              default: false
            properties:
              type: boolean
              default: false
            noteLong:
              type: boolean
              default: false
            noteShort:
              type: boolean
              default: false
            transportPricePerUnit:
              type: boolean
              default: false
            validFromDate:
              type: boolean
              default: false
            requiredByDate:
              type: boolean
              default: false
            deleted:
              type: boolean
              default: false
      required:
        - contractId
        - quantity
    CarrierLargeContractContentMappingRequest:
      type:
        - object
        - 'null'
      description: Specific information about the content of the contract
      default: null
      properties:
        description:
          type: string
          description: Description of the payload
        productBundle:
          type: object
          description: Details of the products carted
          properties:
            payload:
              type: array
              items:
                type: object
                properties:
                  quantity:
                    type: number
                    description: This item quantity
                  product:
                    $ref: '#/components/schemas/ProductMappingRequest'
                  properties:
                    $ref: '#/components/schemas/CustomProperties'
    CarrierLargeContractMappingRequests:
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/CarrierCustomerMappingRequest'
        content:
          $ref: '#/components/schemas/CarrierLargeContractContentMappingRequest'
        product:
          $ref: '#/components/schemas/CarrierProductMappingRequest'
        fromLocation:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        toLocation:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        branch:
          $ref: '#/components/schemas/CarrierBranchMappingRequest'
      required:
        - customer
        - product
        - fromLocation
        - toLocation
    CarrierOrderLeg:
      type: object
      required:
        - fromLocation
        - toLocation
      properties:
        fromLocation:
          $ref: '#/components/schemas/Location'
        fromDateAndTimeConstraint:
          oneOf:
            - $ref: '#/components/schemas/DateAndTimeConstraint'
            - type: 'null'
        fromVehicleMetadata:
          type:
            - object
            - 'null'
          additionalProperties: true
        toLocation:
          $ref: '#/components/schemas/Location'
        toDateAndTimeConstraint:
          oneOf:
            - $ref: '#/components/schemas/DateAndTimeConstraint'
            - type: 'null'
        toVehicleMetadata:
          type:
            - object
            - 'null'
          additionalProperties: true
        sequence:
          type: number
        vehicleId:
          type:
            - string
            - 'null'
    Branch:
      type: object
      properties:
        id:
          type: string
        name:
          type:
            - string
            - 'null'
        externalId:
          type:
            - string
            - 'null'
    CarrierOrder:
      type: object
      properties:
        orderId:
          type: string
        deleted:
          type: boolean
        canceled:
          type: boolean
        cancellationNotes:
          type:
            - string
            - 'null'
          default: null
        cancellationReason:
          type:
            - string
            - 'null'
          default: null
        agent:
          oneOf:
            - $ref: '#/components/schemas/Agent'
            - type: 'null'
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/CarrierAttachment'
        bookingId:
          type:
            - string
            - 'null'
          default: null
        customerBookingId:
          type:
            - string
            - 'null'
          default: null
        billingEntityId:
          type: string
          deprecated: true
          description: Legacy field for customerId
        bookingEntityId:
          type: string
        carrierId:
          type: string
        consignmentId:
          type:
            - string
            - 'null'
        customerId:
          type: string
          description: Internal ID of the customer associated with this order
        customerExternalId:
          type:
            - string
            - 'null'
          description: External ID of the customer associated with this order
        customerIntegrationId:
          type:
            - string
            - 'null'
          description: Integration ID of the customer associated with this order
        customerName:
          type:
            - string
            - 'null'
          description: Name of the customer associated with this order
        created:
          type: string
          format: date-time
        createdBy:
          type:
            - string
            - 'null'
          description: The name of the user who created the order
        updated:
          type: string
          format: date-time
        externalId:
          type:
            - string
            - 'null'
        externalNote:
          type:
            - string
            - 'null'
        largeContractId:
          type:
            - string
            - 'null'
        productCode:
          type:
            - string
            - 'null'
          description: M2X internal tracking id for the product code used
          default: null
        productCodeName:
          type:
            - string
            - 'null'
          description: M2X name for the product code used
          default: null
        productCodeExternalId:
          type:
            - string
            - 'null'
          description: External Id for product tracking
          default: null
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing custom properties
          default: null
        productComponents:
          oneOf:
            - type: array
              items:
                $ref: '#/components/schemas/ProductComponent'
            - type: 'null'
          description: The sub components of the product if present
        quantity:
          type: number
          description: The product quantity
          default: 0
        legs:
          type: array
          items:
            $ref: '#/components/schemas/CarrierOrderLeg'
        fromLocation:
          oneOf:
            - $ref: '#/components/schemas/Location'
            - type: 'null'
        toLocation:
          oneOf:
            - $ref: '#/components/schemas/Location'
            - type: 'null'
        defaultLegBranches:
          type: array
          items:
            $ref: '#/components/schemas/Branch'
          description: >-
            The branches that will be applied to the legs of the order by
            default. When a leg is created, all of the defaultLegBranches will
            be applied to the branches field of the leg. Updating the
            defaultLegBranches will not update the branches field of existing
            legs.
    CarrierOrderRequest:
      type: object
      properties:
        orderId:
          type: string
        externalId:
          type: string
        externalNote:
          type: string
        bookingId:
          type: string
        customerBookingId:
          type: string
        largeContractId:
          type: string
        quantity:
          type: number
          description: The product quantity
          default: 0
        properties:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing custom properties
          default: null
        metadata:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: A key value store containing metadata
          default: null
        fromReference:
          type: string
        fromDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        toReference:
          type: string
        toDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
        shortNote:
          type: string
      required:
        - orderId
        - quantity
    CarrierOrderMappingRequests:
      type: object
      properties:
        customer:
          $ref: '#/components/schemas/CarrierCustomerMappingRequest'
        content:
          $ref: '#/components/schemas/CarrierContentMappingRequest'
        product:
          $ref: '#/components/schemas/CarrierProductMappingRequest'
        fromLocation:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        toLocation:
          $ref: '#/components/schemas/CarrierLocationMappingRequest'
        defaultLegBranches:
          type: array
          items:
            $ref: '#/components/schemas/CarrierBranchMappingRequest'
          description: >-
            The branches that will be applied to the legs of the order by
            default. When a leg is created, all of the defaultLegBranches will
            be applied to the branches field of the leg. Updating the
            defaultLegBranches will not update the branches field of existing
            legs.
      required:
        - customer
        - product
        - fromLocation
        - toLocation
    ConstantValue:
      type:
        - object
        - 'null'
      properties:
        type:
          description: Can be MIN or TOTAL. MIN refers to a minimum charge on a ratecard
          type: string
          example: TOTAL
        value:
          type: number
          example: 35
          description: The value used for the price
      required:
        - type
        - value
    ScaledQuantityValue:
      type:
        - object
        - 'null'
      properties:
        quantityName:
          type: string
          description: The quantity used to calculate the price
          example: WEIGHT
        pricePerUnit:
          type: number
          example: 10.5
          description: The price per unit of the specified quantity
        unitOfMeasure:
          type: string
          example: tn
          description: >-
            The SI (or well known) unit of measure of the value in quantityName,
            E.g. lb, tn (US short ton), kg, m3, km, cwt (hundredweight), t
            (metric tonne).
        value:
          description: The value used to multiply with the pricePerUnit to get a price
          example: 25
          type: number
      required:
        - quantityName
        - pricePerUnit
        - unitOfMeasure
        - value
    LookupQuantityValue:
      type:
        - object
        - 'null'
      properties:
        quantityName:
          type: string
          example: WEIGHT
          description: The quantity used to lookup the price
        unitOfMeasure:
          type: string
          example: tn
          description: >-
            The SI (or well known) unit of measure of the value in quantityName,
            E.g. lb, tn (US short ton), kg, m3, km, cwt (hundredweight), t
            (metric tonne).
        value:
          type: number
          example: 35
          description: The value used to lookup the price in the ratecard
      required:
        - quantityName
        - unitOfMeasure
        - value
    ChargePriceDetail:
      type:
        - object
        - 'null'
      description: >-
        The price detail for a charge, containing the source of the price, and
        how it was calculated
      properties:
        constantValue:
          $ref: '#/components/schemas/ConstantValue'
          description: >-
            The constant value used for the charge price, e.g. an overall min
            charge or a total charge for a rating bracket in a rate card
        description:
          type:
            - string
            - 'null'
          example: B-Double
          description: >-
            The description specified in the rate card for the rate bracket that
            was used to price
        lookupQuantityValue:
          $ref: '#/components/schemas/LookupQuantityValue'
          description: >-
            The value used to lookup the price in a ratecard. Contains the
            quantity name, unit of measure, and the value to compare against the
            ratecard.
        scaledQuantityValue:
          $ref: '#/components/schemas/ScaledQuantityValue'
          description: >-
            The scaled value used for the charge price. Contains a price per
            unit and a quantity
        source:
          type: string
          example: PROVIDED
          description: >-
            Either PROVIDED or RESOLVED. RESOLVED indicates that a ratecard was
            used for pricing. PROVIDED indicates that the price was provided by
            the user
      required:
        - source
    PriceTransportDetail:
      type:
        - object
        - 'null'
      description: >-
        The transport price detail, containing the source of the transport
        price, and how it was calculated
      properties:
        constantValue:
          $ref: '#/components/schemas/ConstantValue'
          description: The constant value used for the transport price
        description:
          type:
            - string
            - 'null'
          example: B-Double
          description: >-
            The description specified in the rate card for the rate bracket that
            was used to price
        lookupQuantityValue:
          $ref: '#/components/schemas/LookupQuantityValue'
          description: >-
            The value used to lookup the price in a ratecard. Contains the
            quantity name, unit of measure, and the value to compare against the
            ratecard.
        scaledQuantityValue:
          $ref: '#/components/schemas/ScaledQuantityValue'
          description: >-
            The scaled value used for the transport price. Contains a price per
            unit and a quantity
        source:
          type: string
          example: PROVIDED
          description: >-
            Either PROVIDED or RESOLVED. RESOLVED indicates that a ratecard was
            used for pricing. PROVIDED indicates that the price was provided by
            the user
      required:
        - source
    PriceFafDetail:
      type:
        - object
        - 'null'
      description: >-
        The adjustment price detail, containing the source of the adjustment
        price, and the how it was calculated
      properties:
        constantValue:
          $ref: '#/components/schemas/ConstantValue'
          description: The constant value used for the adjustment price
        scaledQuantityValue:
          $ref: '#/components/schemas/ScaledQuantityValue'
          description: The scaled value used for the adjustment price
        source:
          type: string
          example: RESOLVED
          description: >-
            Either PROVIDED or RESOLVED. RESOLVED indicates that a ratecard was
            used for pricing. PROVIDED indicates that the price was provided by
            the user
      required:
        - source
    MasterBookingProductRequest:
      type: object
      properties:
        productCode:
          $ref: '#/components/schemas/ProductMappingRequest'
        quantity:
          type:
            - number
            - 'null'
        productBundle:
          type: object
          description: details of the product components
          properties:
            payload:
              type: array
              items:
                type: object
                properties:
                  itemId:
                    type: string
                  quantity:
                    type: number
                    description: this item quantity
                  description:
                    type: string
                  massKg:
                    type: number
                    description: optional override for the weight
                  netWeightKg:
                    type: number
                    description: the net weight of the product line item
                  tareWeightKg:
                    type: number
                    description: the net weight of the product line item
                  spatialRequirement:
                    type: number
                    description: optional override for the volume
                  unitOfMeasure:
                    type: string
                    description: optional unit of measure (e.g. bags)
                  product:
                    $ref: '#/components/schemas/ProductMappingRequest'
                  commodityCode:
                    type: string
                    description: optional commodity code
                  commodityDescription:
                    type: string
                    description: optional commodity description
                  orderNumber:
                    type: string
                    description: optional order number
                  metadata:
                    type: object
                    description: opaque passenger data
                    default: null
                  properties:
                    type: object
                    description: >-
                      a key value store containing bespoke properties usable for
                      pricing and optimisation
                    default: null
    MasterBookingMovement:
      type: object
      description: A container movement.
      properties:
        sequence:
          type: number
          description: The sequence number of the movement within the segment
        type:
          type: string
          enum:
            - LOADED
            - EMPTY
          description: The type of container movement
        carrierId:
          type: string
          description: The carrier ID responsible for this movement
        bookingId:
          type: string
          description: The booking ID associated with this movement
        pickupLocation:
          $ref: '#/components/schemas/Location'
          description: The pickup location for the container
        pickupLocationGroup:
          $ref: '#/components/schemas/LocationGroup'
          description: The pickup location group for the container
        pickupDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
          description: The time constraint for container pickup operations
        deliveryLocation:
          $ref: '#/components/schemas/Location'
          description: The delivery location for the container
        deliveryLocationGroup:
          $ref: '#/components/schemas/LocationGroup'
          description: The delivery location group for the container
        deliveryDateAndTimeConstraint:
          $ref: '#/components/schemas/DateAndTimeConstraint'
          description: The time constraint for container delivery operations
    MasterBookingBase:
      type: object
      description: Base properties shared across all master booking types.
      properties:
        transportMode:
          type: string
          enum:
            - COASTAL
            - RAIL
            - ROAD
          deprecated: true
        masterBookingId:
          type: string
        externalId:
          type: string
        shipmentId:
          type: string
        emptyReleaseNumber:
          type: string
        releaseNumber:
          type: string
        containerNumber:
          type: string
        containerSealNumber:
          type: string
        customer:
          type: object
          properties:
            customerId:
              type: string
            customerName:
              type: string
            externalId:
              type: string
            integrationId:
              type: string
        recipientCustomer:
          type: string
        shippingTemperature:
          type: number
        actualPackTemperature:
          type: number
        unNumber:
          type: string
        commodityCode:
          type: string
        commodityDescription:
          type: string
        dangerousGoods:
          type: boolean
        ambientTimeHours:
          type: number
        activeRefrigeration:
          type: boolean
        powerOffDateTime:
          type: string
        grossWeightKg:
          type: number
        netWeightKg:
          type: number
        tareWeightKg:
          type: number
        spatialRequirement:
          type: number
        salesOrderNumber:
          type: string
        purchaseOrderNumber:
          type: string
        customerOrderNumber:
          type: string
        specialInstructions:
          type: string
        internalNotes:
          type: string
        feederVessel:
          type: string
        feederVoyageNumber:
          type: string
        oceanVessel:
          type: string
        oceanVoyageNumber:
          type: string
        shippingCarrier:
          type: string
        shippingBookingReference:
          type: string
        portOfDischarge:
          type: string
        destinationCountry:
          type: string
        portOfDispatch:
          type: string
        originCountry:
          type: string
        product:
          type: object
          properties:
            productBundle:
              type:
                - object
                - 'null'
            productCode:
              type: object
              properties:
                productCodeName:
                  type:
                    - string
                    - 'null'
                productCodeId:
                  type: string
                productCodeExternalId:
                  type: string
            productId:
              type:
                - string
                - 'null'
            quantity:
              type:
                - number
                - 'null'
        bookingIds:
          type: array
          items:
            type: string
        keyWaypoints:
          type: object
          description: contains a list of key waypoints
          properties:
            EMPTY_PICKUP:
              description: (optional) the pickup location of an empty container
              $ref: '#/components/schemas/MasterBookingKeyWaypoint'
            EMPTY_DELIVERY:
              description: (optional) the delivery location of an empty container
              $ref: '#/components/schemas/MasterBookingKeyWaypoint'
            PICKUP:
              $ref: '#/components/schemas/MasterBookingKeyWaypoint'
            DELIVERY:
              $ref: '#/components/schemas/MasterBookingKeyWaypoint'
            PORT_OF_LOADING:
              description: (optional) the port of loading for export
              $ref: '#/components/schemas/MasterBookingPort'
            PORT_OF_DISCHARGE:
              description: (optional) the port of discharge for import
              $ref: '#/components/schemas/MasterBookingPort'
        movements:
          type: array
          items:
            $ref: '#/components/schemas/MasterBookingMovement'
        properties:
          type: object
          description: A key value store containing custom properties
          additionalProperties: true
        canceled:
          type: boolean
        createdBy:
          type: object
          properties:
            userId:
              type: string
            userName:
              type: string
            email:
              type: string
            sourceId:
              type: string
        created:
          type: string
        updated:
          type: string
    MasterBookingExport:
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/MasterBookingBase'
        - type: object
          description: A master booking for export container operations.
          properties:
            type:
              type: string
              const: EXPORT
              description: The type of container transportation (export)
            segments:
              type: object
              description: >-
                Container movement segments for export operations (pre-movement
                and main movement only)
              properties:
                pre:
                  $ref: '#/components/schemas/MasterBookingAuxiliarySegment'
                  description: Pre-movement segment for container operations
                main:
                  $ref: '#/components/schemas/MasterBookingMainSegmentExport'
                  description: Main export movement segment for container operations
              required:
                - main
    MasterBookingImport:
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/MasterBookingBase'
        - type: object
          description: A master booking for import container operations.
          properties:
            type:
              type: string
              const: IMPORT
              description: The type of container transportation (import)
            segments:
              type: object
              description: >-
                Container movement segments for import operations (main movement
                and post-movement only)
              properties:
                main:
                  $ref: '#/components/schemas/MasterBookingMainSegmentImport'
                  description: Main import movement segment for container operations
                post:
                  $ref: '#/components/schemas/MasterBookingAuxiliarySegment'
                  description: Post-movement segment for container operations
              required:
                - main
    MasterBookingMove:
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/MasterBookingBase'
        - type: object
          description: A master booking for domestic move container operations.
          properties:
            type:
              type: string
              const: MOVE
              description: The type of container transportation (domestic move)
            segments:
              type: object
              description: >-
                Container movement segments for domestic move operations (all
                segment types available)
              properties:
                pre:
                  $ref: '#/components/schemas/MasterBookingAuxiliarySegment'
                  description: Pre-movement segment for container operations
                main:
                  $ref: '#/components/schemas/MasterBookingMainSegmentMove'
                  description: Main move segment for container operations
                post:
                  $ref: '#/components/schemas/MasterBookingAuxiliarySegment'
                  description: Post-movement segment for container operations
              required:
                - main
    MasterBooking:
      description: >-
        A master booking for container transportation operations. The structure
        varies based on the operation type (export, import, or domestic move).
      discriminator:
        propertyName: type
        mapping:
          EXPORT: '#/components/schemas/MasterBookingExport'
          IMPORT: '#/components/schemas/MasterBookingImport'
          MOVE: '#/components/schemas/MasterBookingMove'
      oneOf:
        - $ref: '#/components/schemas/MasterBookingExport'
        - $ref: '#/components/schemas/MasterBookingImport'
        - $ref: '#/components/schemas/MasterBookingMove'
    MasterBookingAuxiliarySegment:
      allOf:
        - $ref: '#/components/schemas/MasterBookingSegmentBase'
        - type: object
          description: >-
            An auxiliary segment of a master booking representing a sequence of
            container movements.
          properties:
            shippingInformation:
              type: object
              oneOf:
                - $ref: '#/components/schemas/MasterBookingSegmentMoveInformation'
                - type:
                    - 'null'
              description: >
                The container shipping information for the segment for domestic
                move. Usually for empty container movements.
    MasterBookingSegmentBase:
      type: object
      description: Base properties for segments of a master booking.
      properties:
        tentative:
          type: boolean
          description: >-
            Whether the segment is tentative for scheduling. If true, no
            movements will be generated for this segment.
        transportMode:
          type: string
          enum:
            - COASTAL
            - RAIL
            - ROAD
          description: The transport mode for the segment.
        effectiveTransportMode:
          type:
            - string
            - 'null'
          enum:
            - COASTAL
            - RAIL
            - ROAD
          description: The effective transport mode for the segment.
        placeOfPickup:
          description: The container pickup location and time window.
          type: object
          properties:
            location:
              $ref: '#/components/schemas/Location'
              description: The location where the container is picked up.
            dateTimeWindow:
              $ref: '#/components/schemas/TimeWindow'
              description: The time window for container pickup operations.
        placeOfDelivery:
          description: The container delivery location and time window.
          type: object
          properties:
            location:
              $ref: '#/components/schemas/Location'
              description: The location where the container is delivered.
            dateTimeWindow:
              $ref: '#/components/schemas/TimeWindow'
              description: The time window for container delivery operations.
        movements:
          type: array
          items:
            $ref: '#/components/schemas/MasterBookingMovement'
          description: The movements for the segment.
    MasterBookingMainSegmentExport:
      allOf:
        - $ref: '#/components/schemas/MasterBookingSegmentBase'
        - type: object
          description: Main segment for export container operations.
          properties:
            shippingInformation:
              $ref: '#/components/schemas/MasterBookingSegmentExportInformation'
              description: Export-specific shipping information for the segment.
    MasterBookingMainSegmentImport:
      allOf:
        - $ref: '#/components/schemas/MasterBookingSegmentBase'
        - type: object
          description: Main segment for import container operations.
          properties:
            shippingInformation:
              $ref: '#/components/schemas/MasterBookingSegmentImportInformation'
              description: Import-specific shipping information for the segment.
    MasterBookingMainSegmentMove:
      allOf:
        - $ref: '#/components/schemas/MasterBookingSegmentBase'
        - type: object
          description: Main segment for domestic move container operations.
          properties:
            shippingInformation:
              $ref: '#/components/schemas/MasterBookingSegmentMoveInformation'
              description: Move-specific shipping information for the segment.
    MasterBookingMoveTimeConstraint:
      type: object
      description: Time constraint information for domestic container movements.
      properties:
        dateTime:
          type: string
          format: date-time
          description: The cut-off date and time for the container movement operation
        constraintType:
          type: string
          enum:
            - AVAILABLE
    MasterBookingImportTimeConstraint:
      type: object
      description: Time constraint information for import container operations.
      properties:
        dateTime:
          type: string
          format: date-time
          description: The cut-off date and time for the import container operation
        constraintType:
          type: string
          enum:
            - AVAILABLE
    MasterBookingExportTimeConstraint:
      type: object
      description: Time constraint information for export container operations.
      properties:
        dateTime:
          type: string
          format: date-time
          description: The cut-off date and time for the export container operation
        constraintType:
          type: string
          enum:
            - AVAILABLE
    MasterBookingRequestSegmentMoveInformation:
      type: object
      description: Information for domestic container movements between locations.
      properties:
        timeConstraints:
          type: array
          items:
            $ref: '#/components/schemas/MasterBookingMoveTimeConstraint'
          description: Time constraints for the domestic container movement operations
    MasterBookingSegmentMoveInformation:
      type: object
      description: Information for domestic container movements between locations.
      properties:
        timeConstraints:
          type: array
          items:
            $ref: '#/components/schemas/MasterBookingMoveTimeConstraint'
          description: Time constraints for the domestic container movement operations
    MasterBookingRequestSegmentImportInformation:
      type: object
      description: >-
        Information for import container operations from overseas to domestic
        locations.
      properties:
        timeConstraints:
          type: array
          items:
            $ref: '#/components/schemas/MasterBookingImportTimeConstraint'
          description: Time constraints for the import container operations
        portOfDischarge:
          type: object
          properties:
            location:
              $ref: '#/components/schemas/LocationMappingRequest'
              description: The port where the container is discharged from the vessel.
            timeConstraints:
              type: array
              items:
                type: object
                properties:
                  dateTime:
                    type: string
                    format: date-time
                    description: >-
                      The time constraint date and time for the import container
                      operations at the port of discharge.
                  constraintType:
                    type: string
                    enum:
                      - ESTIMATED_ARRIVAL
        placeOfCollection:
          type: object
          properties:
            location:
              $ref: '#/components/schemas/LocationMappingRequest'
              description: The location where the container is collected after discharge.
            timeConstraints:
              type: array
              items:
                type: object
                properties:
                  dateTime:
                    type: string
                    format: date-time
                    description: >-
                      The time constraint date and time for the import container
                      operations at the port of collection.
                  constraintType:
                    type: string
                    enum:
                      - ESTIMATED_ARRIVAL
    MasterBookingSegmentImportInformation:
      type: object
      description: >-
        Information for import container operations from overseas to domestic
        locations.
      properties:
        timeConstraints:
          type: array
          items:
            $ref: '#/components/schemas/MasterBookingImportTimeConstraint'
          description: Time constraints for the import container operations
        portOfDischarge:
          type: object
          properties:
            location:
              $ref: '#/components/schemas/Location'
              description: The port where the container is discharged from the vessel.
            timeConstraints:
              type: array
              items:
                type: object
                properties:
                  dateTime:
                    type: string
                    format: date-time
                    description: >-
                      The time constraint date and time for the import container
                      operations at the port of discharge.
                  constraintType:
                    type: string
                    enum:
                      - ESTIMATED_ARRIVAL
        placeOfCollection:
          type: object
          properties:
            location:
              $ref: '#/components/schemas/Location'
              description: The location where the container is collected after discharge.
            timeConstraints:
              type: array
              items:
                type: object
                properties:
                  dateTime:
                    type: string
                    format: date-time
                    description: >-
                      The time constraint date and time for the import container
                      operations at the port of collection.
                  constraintType:
                    type: string
                    enum:
                      - ESTIMATED_ARRIVAL
    MasterBookingRequestSegmentExportInformation:
      type: object
      description: >-
        Information for export container operations from domestic locations to
        overseas.
      properties:
        timeConstraints:
          type: array
          items:
            $ref: '#/components/schemas/MasterBookingExportTimeConstraint'
          description: Time constraints for the export container operations
        placeOfReceipt:
          type: object
          properties:
            location:
              $ref: '#/components/schemas/LocationMappingRequest'
              description: >-
                The location where the container is received before loading onto
                the vessel.
            timeConstraints:
              type: array
              items:
                type: object
                properties:
                  dateTime:
                    type: string
                    format: date-time
                    description: >-
                      The time constraint date and time for the export container
                      operations at the place of receipt.
                  constraintType:
                    type: string
                    enum:
                      - ESTIMATED_DEPARTURE
                      - EARLIEST_RECEIVAL
                      - SHIP_CUT_OFF
        portOfLoading:
          type: object
          properties:
            location:
              $ref: '#/components/schemas/LocationMappingRequest'
              description: >-
                The port where the container is loaded onto the vessel for
                export.
            timeConstraints:
              type: array
              items:
                type: object
                properties:
                  dateTime:
                    type: string
                    format: date-time
                    description: >-
                      The time constraint date and time for the export container
                      operations at the port of loading.
                  constraintType:
                    type: string
                    enum:
                      - ESTIMATED_DEPARTURE
    MasterBookingSegmentExportInformation:
      type: object
      description: >-
        Information for export container operations from domestic locations to
        overseas.
      properties:
        timeConstraints:
          type: array
          items:
            $ref: '#/components/schemas/MasterBookingExportTimeConstraint'
          description: Time constraints for the export container operations
        placeOfReceipt:
          type: object
          properties:
            location:
              $ref: '#/components/schemas/Location'
              description: >-
                The location where the container is received before loading onto
                the vessel.
            timeConstraints:
              type: array
              items:
                type: object
                properties:
                  dateTime:
                    type: string
                    format: date-time
                    description: >-
                      The time constraint date and time for the export container
                      operations at the place of receipt.
                  constraintType:
                    type: string
                    enum:
                      - ESTIMATED_DEPARTURE
                      - EARLIEST_RECEIVAL
                      - SHIP_CUT_OFF
        portOfLoading:
          type: object
          properties:
            location:
              $ref: '#/components/schemas/Location'
              description: >-
                The port where the container is loaded onto the vessel for
                export.
            timeConstraints:
              type: array
              items:
                type: object
                properties:
                  dateTime:
                    type: string
                    format: date-time
                    description: >-
                      The time constraint date and time for the export container
                      operations at the port of loading.
                  constraintType:
                    type: string
                    enum:
                      - ESTIMATED_DEPARTURE
    MasterBookingRequestAuxiliarySegment:
      allOf:
        - $ref: '#/components/schemas/MasterBookingRequestSegmentBase'
        - type: object
          description: >-
            An auxiliary segment of a master booking representing a sequence of
            container movements.
          properties:
            shippingInformation:
              type: object
              oneOf:
                - $ref: >-
                    #/components/schemas/MasterBookingRequestSegmentMoveInformation
                - type:
                    - 'null'
              description: >
                The container shipping information for the segment of the empty
                container.
    MasterBookingRequestSegmentBase:
      type: object
      description: Base properties for main segments of a master booking.
      properties:
        tentative:
          type: boolean
          description: >-
            Whether the segment is tentative for scheduling. If true, no
            movements will be generated for this segment.
        options:
          type: object
          description: Options for how to process this segment during update operations.
          properties:
            regenerateMovements:
              type: boolean
              description: >-
                Whether to regenerate movements for this segment. When true,
                existing movements will be regenerated based on current business
                rules and legging templates.
          additionalProperties: false
        transportMode:
          type: string
          enum:
            - COASTAL
            - RAIL
            - ROAD
          description: The mode of transport for the container
        placeOfPickup:
          description: The container pickup location and time window.
          type: object
          properties:
            location:
              $ref: '#/components/schemas/LocationMappingRequest'
              description: The location where the container is picked up.
            dateTimeWindow:
              $ref: '#/components/schemas/TimeWindow'
              description: The time window for container pickup operations.
        placeOfDelivery:
          description: The container delivery location and time window.
          type: object
          properties:
            location:
              $ref: '#/components/schemas/LocationMappingRequest'
              description: The location where the container is delivered.
            dateTimeWindow:
              $ref: '#/components/schemas/TimeWindow'
              description: The time window for container delivery operations.
    MasterBookingRequestMainSegmentExport:
      allOf:
        - $ref: '#/components/schemas/MasterBookingRequestSegmentBase'
        - type: object
          description: Main segment for export container operations.
          properties:
            shippingInformation:
              $ref: >-
                #/components/schemas/MasterBookingRequestSegmentExportInformation
              description: Export-specific shipping information for the segment.
    MasterBookingRequestMainSegmentImport:
      allOf:
        - $ref: '#/components/schemas/MasterBookingRequestSegmentBase'
        - type: object
          description: Main segment for import container operations.
          properties:
            shippingInformation:
              $ref: >-
                #/components/schemas/MasterBookingRequestSegmentImportInformation
              description: Import-specific shipping information for the segment.
    MasterBookingRequestMainSegmentMove:
      allOf:
        - $ref: '#/components/schemas/MasterBookingRequestSegmentBase'
        - type: object
          description: Main segment for domestic move container operations.
          properties:
            shippingInformation:
              $ref: '#/components/schemas/MasterBookingRequestSegmentMoveInformation'
              description: Move-specific shipping information for the segment.
    MasterBookingRequestBase:
      type: object
      description: Base properties shared across all master booking request types.
      properties:
        transportMode:
          type: string
          enum:
            - COASTAL
            - RAIL
            - ROAD
          description: >-
            The primary mode of transport for the container. Deprecated in
            favour of segment level transport mode.
          deprecated: true
        shipmentId:
          type: string
          description: Unique identifier for the container shipment
        emptyReleaseNumber:
          type: string
          description: Release number for empty container pickup authorization
        releaseNumber:
          type:
            - string
            - 'null'
          description: Release number for loaded container pickup authorization
        containerNumber:
          type:
            - string
            - 'null'
          description: The ISO standard container number
        containerSealNumber:
          type:
            - string
            - 'null'
          description: The customs seal number attached to the container
        customer:
          $ref: '#/components/schemas/CorporateCustomerMappingRequest'
          description: The customer requesting the container transportation
        recipientCustomer:
          type:
            - string
            - 'null'
          description: The recipient customer for the container shipment
        shippingTemperature:
          type:
            - number
            - 'null'
          description: Required shipping temperature for refrigerated containers
        actualPackTemperature:
          type:
            - number
            - 'null'
          description: Actual temperature when the container was packed
        unNumber:
          type:
            - string
            - 'null'
          description: UN number for dangerous goods classification
        commodityCode:
          type:
            - string
            - 'null'
          description: Commodity code for customs classification
        commodityDescription:
          type:
            - string
            - 'null'
          description: Description of the goods in the container
        dangerousGoods:
          type:
            - boolean
            - 'null'
          description: Whether the container contains dangerous goods
        ambientTimeHours:
          type:
            - number
            - 'null'
          description: >-
            Maximum time the container can be at ambient temperature (for
            refrigerated goods)
        activeRefrigeration:
          type:
            - boolean
            - 'null'
          description: Whether the container requires active refrigeration during transport
        powerOffDateTime:
          type:
            - string
            - 'null'
          format: date-time
          description: Date and time when refrigeration power is turned off
        grossWeightKg:
          type:
            - number
            - 'null'
          description: Total weight of container and contents (in kilograms)
        netWeightKg:
          type:
            - number
            - 'null'
          description: Weight of goods only, excluding container tare weight (in kilograms)
        tareWeightKg:
          type:
            - number
            - 'null'
          description: Weight of the empty container (in kilograms)
        spatialRequirement:
          type:
            - number
            - 'null'
          description: Volume requirement for the container contents (in cubic meters)
        salesOrderNumber:
          type:
            - string
            - 'null'
          description: Customer's sales order number for the container shipment
        purchaseOrderNumber:
          type:
            - string
            - 'null'
          description: Customer's purchase order number for the container shipment
        customerOrderNumber:
          type:
            - string
            - 'null'
          description: Customer's internal order number for the container shipment
        specialInstructions:
          type:
            - string
            - 'null'
          description: Special handling instructions for the container
        internalNotes:
          type:
            - string
            - 'null'
          description: Internal notes for the container booking
        feederVessel:
          type:
            - string
            - 'null'
          description: Name of the feeder vessel for container transport
        feederVoyageNumber:
          type:
            - string
            - 'null'
          description: Voyage number of the feeder vessel
        oceanVessel:
          type:
            - string
            - 'null'
          description: Name of the ocean vessel for international container transport
        oceanVoyageNumber:
          type:
            - string
            - 'null'
          description: Voyage number of the ocean vessel
        shippingCarrier:
          type:
            - string
            - 'null'
          description: Name of the shipping line or carrier
        shippingBookingReference:
          type:
            - string
            - 'null'
          description: Booking reference from the shipping carrier
        portOfDischarge:
          type:
            - string
            - 'null'
          description: Port where the container is discharged from the vessel
        destinationCountry:
          type:
            - string
            - 'null'
          description: Country of destination for the container shipment
        portOfDispatch:
          type:
            - string
            - 'null'
          description: Port where the container is dispatched from
        originCountry:
          type:
            - string
            - 'null'
          description: Country of origin for the container shipment
        product:
          $ref: '#/components/schemas/MasterBookingProductRequest'
          description: Product information for the container contents
        properties:
          type: object
          description: A key value store containing custom properties
          additionalProperties: true
        keyWaypoints:
          type: object
          description: contains a list of key waypoints
          deprecated: true
          properties:
            EMPTY_PICKUP:
              description: (optional) the pickup location of an empty container
              $ref: '#/components/schemas/MasterBookingKeyWaypointRequest'
            EMPTY_DELIVERY:
              description: (optional) the delivery location of an empty container
              $ref: '#/components/schemas/MasterBookingKeyWaypointRequest'
            PICKUP:
              $ref: '#/components/schemas/MasterBookingKeyWaypointRequest'
            DELIVERY:
              $ref: '#/components/schemas/MasterBookingKeyWaypointRequest'
            PORT_OF_LOADING:
              description: (optional) the port of loading for export
              $ref: '#/components/schemas/MasterBookingPortRequest'
            PORT_OF_DISCHARGE:
              description: (optional) the port of discharge for import
              $ref: '#/components/schemas/MasterBookingPortRequest'
      required:
        - shipmentId
    MasterBookingRequestExport:
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/MasterBookingRequestBase'
        - type: object
          description: A master booking request for export container operations.
          properties:
            type:
              type: string
              const: EXPORT
              description: The type of container transportation (export)
            segments:
              type: object
              x-experimental: true
              description: >-
                Container movement segments for export operations (pre-movement
                and main movement only)
              properties:
                pre:
                  $ref: '#/components/schemas/MasterBookingRequestAuxiliarySegment'
                  description: Pre-movement segment for container operations
                main:
                  $ref: '#/components/schemas/MasterBookingRequestMainSegmentExport'
                  description: Main export movement segment for container operations
              required:
                - main
    MasterBookingRequestImport:
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/MasterBookingRequestBase'
        - type: object
          description: A master booking request for import container operations.
          properties:
            type:
              type: string
              const: IMPORT
              description: The type of container transportation (import)
            segments:
              type: object
              x-experimental: true
              description: >-
                Container movement segments for import operations (main movement
                and post-movement only)
              properties:
                main:
                  $ref: '#/components/schemas/MasterBookingRequestMainSegmentImport'
                  description: Main import movement segment for container operations
                post:
                  $ref: '#/components/schemas/MasterBookingRequestAuxiliarySegment'
                  description: Post-movement segment for container operations
              required:
                - main
    MasterBookingRequestMove:
      required:
        - type
      allOf:
        - $ref: '#/components/schemas/MasterBookingRequestBase'
        - type: object
          description: A master booking request for domestic move container operations.
          properties:
            type:
              type: string
              const: MOVE
              description: The type of container transportation (domestic move)
            segments:
              type: object
              x-experimental: true
              description: >-
                Container movement segments for domestic move operations (all
                segment types available)
              properties:
                pre:
                  $ref: '#/components/schemas/MasterBookingRequestAuxiliarySegment'
                  description: Pre-movement segment for container operations
                main:
                  $ref: '#/components/schemas/MasterBookingRequestMainSegmentMove'
                  description: Main move segment for container operations
                post:
                  $ref: '#/components/schemas/MasterBookingRequestAuxiliarySegment'
                  description: Post-movement segment for container operations
              required:
                - main
    MasterBookingRequest:
      description: >-
        A master booking request for container transportation operations. The
        structure varies based on the operation type (export, import, or
        domestic move).
      discriminator:
        propertyName: type
        mapping:
          EXPORT: '#/components/schemas/MasterBookingRequestExport'
          IMPORT: '#/components/schemas/MasterBookingRequestImport'
          MOVE: '#/components/schemas/MasterBookingRequestMove'
      oneOf:
        - $ref: '#/components/schemas/MasterBookingRequestExport'
        - $ref: '#/components/schemas/MasterBookingRequestImport'
        - $ref: '#/components/schemas/MasterBookingRequestMove'
    MasterBookingManifestRequest:
      type: object
      properties:
        masterBookingId:
          type:
            - string
            - 'null'
        releaseNumber:
          type:
            - string
            - 'null'
        containerNumber:
          type:
            - string
            - 'null'
        containerSealNumber:
          type:
            - string
            - 'null'
        customerOrderNumber:
          type:
            - string
            - 'null'
        shippingTemperature:
          type:
            - number
            - 'null'
        actualPackTemperature:
          type:
            - number
            - 'null'
        grossWeightKg:
          type:
            - number
            - 'null'
        netWeightKg:
          type:
            - number
            - 'null'
        tareWeightKg:
          type:
            - number
            - 'null'
        spatialRequirement:
          type:
            - number
            - 'null'
        powerOffDateTime:
          type:
            - string
            - 'null'
          format: date-time
        product:
          $ref: '#/components/schemas/MasterBookingProductRequest'
        activeRefrigeration:
          type: boolean
        dangerousGoods:
          type: boolean
        unNumber:
          type:
            - string
            - 'null'
        commodityCode:
          type:
            - string
            - 'null'
          description: Commodity code for customs classification
        commodityDescription:
          type:
            - string
            - 'null'
          description: Description of the goods in the container
        timestamp:
          type: string
          format: date-time
          description: RFC3339 date time of the manifest
        specialInstructions:
          type:
            - string
            - 'null'
          deprecated: true
        feederVessel:
          type:
            - string
            - 'null'
        feederVoyageNumber:
          type:
            - string
            - 'null'
        oceanVessel:
          type:
            - string
            - 'null'
        oceanVoyageNumber:
          type:
            - string
            - 'null'
        shippingBookingReference:
          type:
            - string
            - 'null'
        shipmentId:
          type:
            - string
            - 'null'
        packDate:
          type:
            - string
            - 'null'
          format: date
        properties:
          type: object
          additionalProperties: true
        metadata:
          type: object
          additionalProperties: true
    MasterBookingExpenseResponse:
      type: object
      required:
        - total
        - expenses
      properties:
        total:
          type:
            - number
            - 'null'
          description: The projected total expense for the master booking
        expenses:
          type: array
          items:
            type: object
            properties:
              bookingId:
                type: string
                description: The booking identifier
              total:
                type: number
                description: The projected total expense for the booking
    MasterBookingRevenueResponse:
      type: object
      required:
        - total
      properties:
        total:
          type:
            - number
            - 'null'
          description: The projected total revenue for the master booking
    MasterBookingKeyWaypointRequest:
      type: object
      properties:
        location:
          $ref: '#/components/schemas/LocationMappingRequest'
        locationGroup:
          $ref: '#/components/schemas/LocationGroupMappingRequest'
        pickupDateTimeWindow:
          type:
            - object
            - 'null'
          properties:
            start:
              type:
                - string
                - 'null'
              format: date-time
            end:
              type:
                - string
                - 'null'
              format: date-time
        deliveryDateTimeWindow:
          type:
            - object
            - 'null'
          properties:
            start:
              type:
                - string
                - 'null'
              format: date-time
            end:
              type:
                - string
                - 'null'
              format: date-time
        departureDateTime:
          type:
            - string
            - 'null'
          format: date-time
        arrivalDateTime:
          type:
            - string
            - 'null'
          format: date-time
        packDate:
          type:
            - string
            - 'null'
          format: date
        availableDate:
          type:
            - string
            - 'null'
          format: date
        portEarliestReceivalDateTime:
          type:
            - string
            - 'null'
          format: date-time
        shipCutOffDateTime:
          type:
            - string
            - 'null'
          format: date-time
    MasterBookingKeyWaypoint:
      type: object
      properties:
        location:
          $ref: '#/components/schemas/Location'
        locationGroup:
          $ref: '#/components/schemas/LocationGroup'
        pickupDateTimeWindow:
          type:
            - object
            - 'null'
          properties:
            start:
              type:
                - string
                - 'null'
              format: date-time
            end:
              type:
                - string
                - 'null'
              format: date-time
        deliveryDateTimeWindow:
          type:
            - object
            - 'null'
          properties:
            start:
              type:
                - string
                - 'null'
              format: date-time
            end:
              type:
                - string
                - 'null'
              format: date-time
        departureDateTime:
          type:
            - string
            - 'null'
          format: date-time
        arrivalDateTime:
          type:
            - string
            - 'null'
          format: date-time
        packDate:
          type:
            - string
            - 'null'
          format: date
        availableDate:
          type:
            - string
            - 'null'
          format: date
        portEarliestReceivalDateTime:
          type:
            - string
            - 'null'
          format: date-time
        shipCutOffDateTime:
          type:
            - string
            - 'null'
          format: date-time
    MasterBookingPortRequest:
      type: object
      properties:
        location:
          $ref: '#/components/schemas/LocationMappingRequest'
        locationGroup:
          $ref: '#/components/schemas/LocationGroupMappingRequest'
        departureDateTime:
          type:
            - string
            - 'null'
          format: date-time
        arrivalDateTime:
          type:
            - string
            - 'null'
          format: date-time
        portEarliestReceivalDateTime:
          type:
            - string
            - 'null'
          format: date-time
        shipCutOffDateTime:
          type:
            - string
            - 'null'
          format: date-time
    MasterBookingPort:
      type: object
      properties:
        location:
          $ref: '#/components/schemas/Location'
        locationGroup:
          $ref: '#/components/schemas/LocationGroup'
        departureDateTime:
          type:
            - string
            - 'null'
          format: date-time
        arrivalDateTime:
          type:
            - string
            - 'null'
          format: date-time
        portEarliestReceivalDateTime:
          type:
            - string
            - 'null'
          format: date-time
        shipCutOffDateTime:
          type:
            - string
            - 'null'
          format: date-time
    CorporateCustomerMappingRequest:
      type: object
      description: Parameters to try to map a customer with M2X
      properties:
        customerName:
          type: string
          example: Fruit World
        customerId:
          type: string
          example: Yc7cXUulBhMM58iuOQce
        externalId:
          type: string
          example: FTW
        integrationId:
          type: string
          example: C99
    RegisterTransactionEventRequest:
      type: object
      description: The payload for registration of a transaction event
      required:
        - type
        - timestamp
      properties:
        type:
          type: string
          enum:
            - INVOICE_ISSUED
            - INVOICE_SETTLED
            - CREDIT_NOTE_ISSUED
            - CREDIT_NOTE_SETTLED
          description: The type of the event to register
          example: INVOICE_ISSUED
        timestamp:
          type: string
          format: date-time
          description: The timestamp of the event to register
          example: '2020-01-01T00:00:00Z'
        reference:
          anyOf:
            - type: string
            - type: 'null'
          description: The reference value for the event (if any)
          example: INV-1234
    DynamicFulfilmentActivityPriority:
      type: string
      default: LOW
      enum:
        - LOW
        - MEDIUM
        - HIGH
    DynamicFulfilmentOrderDay:
      type: string
      format: date
      description: >-
        The date from where the deliver will be available for dispatch, if not
        provided, assume today
    DynamicFulfilmentTargetDate:
      type: string
      format: date
      description: The target date for the delivery
    DynamicFulfilmentShortNote:
      type: string
      description: a short note for the delivery, going to the driver
    DynamicFulfilmentOfficeNotes:
      type: string
      description: an office note for the delivery, not going to the driver
    CustomProperties:
      type:
        - object
        - 'null'
      additionalProperties: true
      description: >-
        A key value store containing bespoke properties usable for pricing and
        optimisation
      default: null
    Metadata:
      type:
        - object
        - 'null'
      additionalProperties: true
      description: Opaque passenger data
      default: null
  parameters:
    deliveryRequestIdParam:
      name: deliveryRequestId
      in: path
      description: The unique delivery requests Id
      required: true
      schema:
        type: string
webhooks:
  Booking:
    post:
      tags:
        - Bookings
      summary: Bookings (carrier allocation webhook)
      description: >-
        Webhook type: **BOOKING**


        ### Overview


        This webhook provides notifications of changes to bookings that have
        been allocated to a carrier. It provides the subscriber with the full
        Booking entity, and enables downstream processes such as reporting and
        tracking.


        ### Trigger Conditions


        This webhook is triggered when:

        - The booking is allocated to a carrier through the enterprise platform,
        either via manual assignment or automated workflow.

        - Any update is made to the booking through the enterprise environment
        whilst the carrier is allocated.
      operationId: bookingWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Booking'
      responses:
        '200':
          description: Webhook received successfully
  Booking Event:
    post:
      tags:
        - Bookings
      summary: Corporate booking event webhook
      description: >-
        webhook type: **FACT**


        ### Overview


        This webhook allows you to receive notifications when booking events are
        created or updated. This could be due to changes made in the carrier
        TMS, mobile app, or in external systems via the M2X API.


        Possible event types are listed in the description of the `event` field
        of the payload.


        ### Trigger Conditions


        This webhook is triggered when:

        - A booking event is created or updated.  See below for the list of
        possible events.
      operationId: factsWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookingEvent'
      responses:
        '200':
          description: Webhook received successfully
  Offer:
    post:
      tags:
        - Offers
      summary: Offer webhook
      description: 'webhook type: **OFFER**'
      operationId: offerWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Offer'
      responses:
        '200':
          description: Webhook received successfully
  Site Fulfilment:
    post:
      tags:
        - Fulfilment Requests
      summary: Site fulfilment webhook
      description: 'webhook type: **SITE_FULFILMENT**'
      operationId: siteFulfilmentWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SiteFulfilment'
      responses:
        '200':
          description: Webhook received successfully
  Fulfilment Request:
    post:
      tags:
        - Fulfilment Requests
      summary: Fulfilment request webhook
      description: 'webhook type: **FULFILMENT_REQUEST**'
      operationId: fulfilmentRequestWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FulfilmentRequest'
      responses:
        '200':
          description: Webhook received successfully
  Location:
    post:
      tags:
        - Locations
      summary: Location webhook
      description: 'webhook type: **LOCATION**'
      operationId: locationWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Location'
                - type: object
                  properties:
                    action:
                      type: string
                      enum:
                        - create
                        - update
                        - disable
                      description: The action that was performed on the location
                      example: create
      responses:
        '200':
          description: Webhook received successfully
  Master Booking:
    post:
      tags:
        - Master Bookings
      summary: Master booking webhook
      description: 'webhook type: **MASTER_BOOKING**'
      operationId: masterBookingWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MasterBooking'
      responses:
        '200':
          description: Webhook received successfully
  Shift Publication:
    post:
      tags:
        - Vehicle
      summary: Shift publication webhook
      description: 'webhook type: **SHIFT_PUBLICATION**'
      operationId: shiftPublicationWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishedShift'
      responses:
        '200':
          description: Webhook received successfully
  Service Day Publication:
    post:
      tags:
        - Vehicle
      summary: Service day publication webhook
      description: 'webhook type: **SERVICE_DAY_PUBLICATION**'
      operationId: serviceDayPublicationWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/PublishedShift'
      responses:
        '200':
          description: Webhook received successfully
  Job:
    post:
      tags:
        - Jobs
      summary: Job webhook
      description: 'webhook type: **JOB**'
      operationId: jobWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Job'
      responses:
        '200':
          description: Webhook received successfully
  Invoice:
    post:
      tags:
        - Billing Groups
      summary: Invoice webhook
      description: 'webhook type: **INVOICE**'
      operationId: invoiceWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Invoice'
      responses:
        '200':
          description: Webhook received successfully
  Billing Group Details:
    post:
      tags:
        - Billing Groups
      summary: Billing group details webhook
      description: 'webhook type: **BILLING_GROUP_DETAILS**'
      operationId: billingGroupDetailsWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BillingGroupDetails'
      responses:
        '200':
          description: Webhook received successfully
  General Consignment Details:
    post:
      tags:
        - Consignments
      summary: General freight consignment details webhook
      description: >-
        webhook type: **GENERAL_CONSIGNMENT_DETAILS**


        ### Overview


        This webhook allows you to receive notifications when general freight
        consignments are created or updated.
      operationId: generalConsignmentDetailsWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeneralConsignment'
      responses:
        '200':
          description: Webhook received successfully
  General Consignment Leg Details:
    post:
      tags:
        - Consignments
      summary: General freight consignment leg details webhook
      description: >-
        webhook type: **GENERAL_CONSIGNMENT_LEG_DETAILS**


        This webhook allows you to receive notifications when general freight
        consignments are created or updated, and includes detailed information
        for each leg of the consignment.
      operationId: generalConsignmentLegDetailsWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GeneralConsignment'
      responses:
        '200':
          description: Webhook received successfully
  Action Step Record:
    post:
      tags:
        - Jobs
      summary: Action step record webhook
      description: 'webhook type: **ACTION_STEP_RECORDS**'
      operationId: actionStepRecordWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActionStepRecord'
      responses:
        '200':
          description: Webhook received successfully
  Vehicle Timeline Statement:
    post:
      tags:
        - Vehicle Execution Statements
      summary: Vehicle timeline statement webhook
      description: 'webhook type: **VEHICLE_TIMELINE_STATEMENT**'
      operationId: vehicleTimelineStatementWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleTimelineStatement'
      responses:
        '200':
          description: Webhook received successfully
  Vehicle Timeline Statements Allocation:
    post:
      tags:
        - Vehicle Execution Statements
      summary: Vehicle timeline statements allocation webhook
      description: 'webhook type: **VEHICLE_TIMELINE_STATEMENTS_ALLOCATION**'
      operationId: vehicleTimelineStatementsAllocationWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleTimelineStatementsAllocation'
      responses:
        '200':
          description: Webhook received successfully
  Vehicle Timeline Statements Allocation Details:
    post:
      tags:
        - Vehicle Execution Statements
      summary: Vehicle timeline statements allocation details webhook
      description: 'webhook type: **VEHICLE_TIMELINE_STATEMENTS_ALLOCATION_DETAILS**'
      operationId: vehicleTimelineStatementsAllocationDetailsWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VehicleTimelineStatementsAllocationDetails'
      responses:
        '200':
          description: Webhook received successfully
  Fuel Pickup:
    post:
      tags:
        - Fuel
      summary: Fuel pickup webhook
      description: 'webhook type: **FUEL_PICKUP**'
      operationId: fuelPickupWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelPickupActivity'
      responses:
        '200':
          description: Webhook received successfully
  Fuel Delivery:
    post:
      tags:
        - Fuel
      summary: Fuel delivery webhook
      description: 'webhook type: **FUEL_DELIVERY**'
      operationId: fuelDeliveryWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelDeliveryActivity'
      responses:
        '200':
          description: Webhook received successfully
  Fuel Dispatch Group Checked:
    post:
      tags:
        - Fuel
      summary: Fuel dispatch group checked webhook
      description: 'webhook type: **FUEL_DISPATCH_GROUP_CHECKED**'
      operationId: fuelDispatchGroupCheckedWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelDispatchGroupActivities'
      responses:
        '200':
          description: Webhook received successfully
  Fuel Shift Checked:
    post:
      tags:
        - Fuel
      summary: Fuel shift checked webhook
      description: 'webhook type: **FUEL_SHIFT_CHECKED**'
      operationId: fuelShiftCheckedWebhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FuelShift'
      responses:
        '200':
          description: Webhook received successfully
