{
  "openapi": "3.0.0",
  "info": {
    "description": "create or update an individual action of a stop in a Load Track. Not all actions are updatable. Only the actions with pickup and delivery numbers are updatable.",
    "version": "1.0.0",
    "title": "Create or pdate an action of a stop",
    "termsOfService": "https://www.truckertools.com/terms",
    "contact": {
      "email": "integrations@truckertools.com"
    },
    "license": {
      "name": "Private",
      "url": "https://api.truckertools.com"
    }
  },
  "security": [],
  "servers": [
    {
      "description": "SwaggerHub API Auto Mocking",
      "url": "https://virtserver.swaggerhub.com/truckertools/ManageActionOfStop/1.0.0"
    }
  ],
  "paths": {
    "/loadtrackservice/LTLstopAction": {
      "post": {
        "summary": "Create an individual action of a stop in a Load Track",
        "operationId": "createLoadTrackStopAction",
        "responses": {
          "200": {
            "description": "successfully created load track stop action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/response"
                }
              }
            }
          }
        },
        "requestBody": {
          "$ref": "#/components/requestBodies/loadTrackStopAction"
        }
      },
      "put": {
        "summary": "Update an individual action of a stop in a Load Track",
        "operationId": "updateLoadTrackStopAction",
        "responses": {
          "200": {
            "description": "successfully update load track stop action",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/response"
                }
              }
            }
          }
        },
        "requestBody": {
          "$ref": "#/components/requestBodies/loadTrackStopAction"
        }
      }
    }
  },
  "components": {
    "schemas": {
      "loadTrackStopAction": {
        "type": "object",
        "required": [
          "partnerId",
          "loadTrackExternalId",
          "accountId",
          "stop"
        ],
        "properties": {
          "partnerId": {
            "type": "integer",
            "description": "This is a unique integer id that is assigned to the Partner system to identify the Partner system by the Load Track system. This has to be sent on each webservice call.",
            "format": "int64"
          },
          "loadTrackExternalId": {
            "type": "number",
            "description": "The unique identifier of the Load in the Partner system"
          },
          "accountId": {
            "type": "string",
            "description": "Unique identifier of the Agent in the Broker System that entered the Load Track. This accountId has to be encrypted with the shared secret of the partner. This shared secret will be shared during the integration process",
            "minLength": 8
          },
          "stop": {
            "$ref": "#/components/schemas/stop"
          }
        }
      },
      "stop": {
        "type": "object",
        "required": [
          "orderNumber"
        ],
        "properties": {
          "orderNumber": {
            "type": "integer",
            "description": "The order of the stop. The number shall start from 1",
            "minimum": 1
          },
          "action": {
            "$ref": "#/components/schemas/action"
          }
        }
      },
      "action": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "name of the action"
          },
          "required": {
            "type": "boolean",
            "description": "flag to indicate if the driver has to mark this to move to next stop",
            "default": false
          },
          "isLastAction": {
            "type": "boolean",
            "description": "flag to indicate if the driver has to mark every other action before he marks this",
            "default": false
          },
          "item": {
            "type": "string",
            "description": "name of pickup or delivery item",
            "minLength": 0,
            "enum": [
              "trailer",
              "load",
              "LTL",
              "package"
            ]
          },
          "id": {
            "type": "string",
            "description": "the unique identifier of the item that is getting picked up that the driver can identify",
            "minLength": 0
          },
          "oldId": {
            "type": "string",
            "description": "the old unique identifier of the item that is getting picked up that the driver can identify that needs to be modified. This is only required in case of modify POST"
          }
        }
      },
      "response": {
        "type": "object",
        "required": [
          "status",
          "timeStamp"
        ],
        "properties": {
          "status": {
            "type": "boolean",
            "description": "flag to indicate service response status i.e true or false",
            "default": false
          },
          "timeStamp": {
            "type": "string",
            "description": "server timestamp"
          },
          "loadId": {
            "type": "integer",
            "description": "unique id in TT system. This is not provided in case of error"
          },
          "numberOfStops": {
            "type": "integer",
            "description": "Number of stops in this load track. This will not be provided in case of an error"
          },
          "errorCode": {
            "type": "integer",
            "description": "Error code. This will not be provided in case of successful creation or update of Load Track",
            "enum": [
              101,
              104,
              105,
              301,
              406,
              407
            ]
          },
          "errorMessage": {
            "type": "string",
            "description": "A short description of the error. This will not be provided in case of successful creation or update of Load Track",
            "enum": [
              "Account not found",
              "Partner not found",
              "Load Track not found",
              "Invalid parameters",
              "Can’t update action as the action is already taken or the stop is complete",
              "Can’t delete action as the action is already taken or the stop is complete"
            ]
          }
        }
      }
    },
    "requestBodies": {
      "loadTrackStopAction": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/loadTrackStopAction"
            }
          }
        },
        "required": true
      }
    }
  }
}