{
  "openapi": "3.0.1",
  "info": {
    "title": "Carriers API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api-playground.loady.com/public/carriers/v1"
    }
  ],
  "paths": {
    "/lanes/{laneId}/logisticsRequirementsText": {
      "get": {
        "tags": [],
        "summary": "Get Logistics Requirements of a Lane in the text format",
        "operationId": "get-carriers-logistics-requirements-text-by-lane-v1",
        "parameters": [
          {
            "name": "laneId",
            "in": "path",
            "description": "Id of lane",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dataValidity",
            "in": "query",
            "description": "Data validity for temperature requirements",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "laneAuthorizationKey",
            "in": "query",
            "description": "Lane authorization key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Accept-Language",
            "in": "header",
            "description": "Language to be used in response",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-company-id",
            "in": "header",
            "description": "Identifies the company within which the operation is performed",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Contains an authorization token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Ocp-Apim-Subscription-Key",
            "in": "header",
            "description": "Subscription key required to use API",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Logistics Requirements in text format",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/logisticsRequirementsTextDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      }
    },
    "/ePLR/check": {
      "post": {
        "tags": [],
        "summary": "Performs pre load restrictions check to identify if tank is allowed based on previously loaded products.",
        "operationId": "post-perform-public-carrier-pre-load-restrictions-check-v1",
        "parameters": [
          {
            "name": "Accept-Language",
            "in": "header",
            "description": "Language to be used in response",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-company-id",
            "in": "header",
            "description": "Identifies the company within which the operation is performed",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Contains an authorization token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Ocp-Apim-Subscription-Key",
            "in": "header",
            "description": "Subscription key required to use API",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/publicCarrierPreLoadRestrictionsCheckRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The result of the check",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/publicPreLoadRestrictionsCheckResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request sent by the client is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/innerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      }
    },
    "/ePLR/scope": {
      "get": {
        "tags": [],
        "summary": "Gets the pre-load restrictions scope of a product by its reference number.",
        "operationId": "get-public-carrier-pre-load-restrictions-scope-v1",
        "parameters": [
          {
            "name": "productReferenceNumber",
            "in": "query",
            "description": "The reference number of the product",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "companyId",
            "in": "query",
            "description": "The company id of the industrial the product belongs to",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-company-id",
            "in": "header",
            "description": "Identifies the company within which the operation is performed",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Authorization",
            "in": "header",
            "description": "Contains an authorization token",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Ocp-Apim-Subscription-Key",
            "in": "header",
            "description": "Subscription key required to use API",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The pre-load restrictions scope of the product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/publicPreLoadRestrictionsScopeResponse"
                }
              }
            }
          },
          "400": {
            "description": "The request sent by the client is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/innerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "innerError": {
        "type": "object",
        "properties": {
          "errorCode": {
            "type": "string"
          },
          "paths": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "condition": {
            "type": "string"
          },
          "errorDetails": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "errorDescription": {
            "type": "string"
          }
        }
      },
      "loadingPointInLogisticsRequirementsTextDto": {
        "type": "object",
        "properties": {
          "productCleaningRequirement": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "productSafety": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "loadingPointSlotBooking": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "loadingPointVehicleAccessRestrictions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "loadingPointAvailableEquipmentPackedGoods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "loadingPointOpeningHours": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "loadingPointContacts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "siteFromSafetySecurityRequirements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assignedProductTechnicalRequirementsVehicle": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assignedProductTechnicalRequirementsBulk": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assignedProductTechnicalRequirementsEquipmentPacked": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assignedProductTechnicalRequirementCargoSecuring": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assignedProductPacking": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assignedProductTechnicalRequirementsTemperatureRequirements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assignedProductDocuments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assignedProductInstructions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "assignedProductTransportPlanning": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "logisticsRequirementsTextDto": {
        "type": "object",
        "properties": {
          "loadingRequirements": {
            "$ref": "#/components/schemas/loadingPointInLogisticsRequirementsTextDto"
          },
          "unloadingRequirements": {
            "$ref": "#/components/schemas/unloadingPointInLogisticsRequirementsTextDto"
          }
        }
      },
      "publicCarrierPreLoadRestrictionsCheckRequest": {
        "type": "object",
        "properties": {
          "companyId": {
            "type": "string",
            "description": "The identifier of the company of the shipper (industrial company) for which the product should be validated"
          },
          "productReferenceNumber": {
            "type": "string",
            "description": "The reference number of the product to be loaded"
          },
          "checkWithCleaning": {
            "type": "boolean",
            "description": "Indicates whether cleaning should be taken into account for this check. When false, the cleaning status and cleaning procedures should not be provided"
          },
          "isClean": {
            "type": "boolean",
            "description": "Indicates whether the tank has been cleaned since the last load",
            "nullable": true
          },
          "cleaningProcedures": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "List of cleaning procedure codes that have been performed on the tank e.g., P10",
            "nullable": true
          },
          "customerReferenceNumber": {
            "type": "string",
            "description": "The reference number of the customer",
            "nullable": true
          },
          "preProducts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/publicPreLoadRestrictionsCheckRequestPreProduct"
            },
            "description": "List of pre-products previously loaded into the tank",
            "nullable": true
          },
          "trackingNumber": {
            "type": "string",
            "description": "Optional correlation identifier included verbatim in the response for tracing purposes",
            "nullable": true
          },
          "requestPlrUpdateForMissingData": {
            "type": "boolean",
            "description": "True if automatically trigger the 'Request PLR update' workflow in case of missing data",
            "nullable": true
          }
        }
      },
      "publicPreLoadRestrictionsCheckRequestPreProduct": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the pre-product"
          },
          "casNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "CAS registry numbers identifying the substance (e.g. 71-43-2 for Benzene)",
            "nullable": true
          },
          "ecNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "EC numbers identifying the substance (e.g. 200-753-7)",
            "nullable": true
          }
        }
      },
      "publicPreLoadRestrictionsCheckResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "productReferenceNumber": {
            "type": "string"
          },
          "plrPolicy": {
            "type": "string"
          },
          "trackingNumber": {
            "type": "string"
          },
          "overallResult": {
            "enum": [
              "TransportAllowed",
              "TransportForbidden",
              "NoData"
            ],
            "type": "string",
            "default": "TransportAllowed"
          },
          "preProductRestrictionsResult": {
            "enum": [
              "TransportAllowed",
              "TransportForbidden",
              "NoData"
            ],
            "type": "string",
            "default": "TransportAllowed"
          },
          "cleaningStateResult": {
            "enum": [
              "TransportAllowed",
              "TransportForbidden",
              "NoData"
            ],
            "type": "string",
            "default": "TransportAllowed",
            "nullable": true
          },
          "cleaningProceduresResult": {
            "enum": [
              "TransportAllowed",
              "TransportForbidden",
              "NoData"
            ],
            "type": "string",
            "default": "TransportAllowed",
            "nullable": true
          }
        }
      },
      "publicPreLoadRestrictionsScopeResponse": {
        "type": "object",
        "properties": {
          "productReferenceNumber": {
            "type": "string",
            "description": "The reference number of the product"
          },
          "numberOfPreloads": {
            "type": "integer",
            "description": "The number of preloads maintained for the product. Null if no data is maintained",
            "format": "int32",
            "nullable": true
          },
          "specialCleaningRequired": {
            "type": "boolean",
            "description": "Indicates whether special cleaning is required for the product"
          }
        }
      },
      "unloadingPointInLogisticsRequirementsTextDto": {
        "type": "object",
        "properties": {
          "companyToSiteCheckIn": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "siteToSafetySecurityRequirements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToUnloadingPointSlotBooking": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unloadingPointVehicleAccessRestrictions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unloadingPointAvailableEquipmentPackedGoods": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unloadingPointOpeningHours": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "unloadingPointContacts": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductTechnicalRequirementsVehicle": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductTechnicalRequirementsBulk": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductTechnicalRequirementsEquipmentPacked": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductTechnicalRequirementCargoSecuring": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductPacking": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductTechnicalRequirementsTemperatureRequirements": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductDocuments": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductInstructions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductInstructionsCustoms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "companyToAssignedProductTransportPlanning": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "SubscriptionKey": {
        "type": "apiKey",
        "in": "header",
        "name": "Ocp-Apim-Subscription-Key",
        "description": "Customer-specific subscription key supplied by Loady."
      },
      "LoadyOAuth": {
        "type": "oauth2",
        "description": "Loady customer authentication using the OAuth 2.0 client credentials flow.",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://auth-playground.loady.com/auth-playground.loady.com/b2c_1_sign_in_publicapi_flow/oauth2/v2.0/token",
            "scopes": {
              "https://auth-playground.loady.com/publicapi/.default": "Access Loady public APIs"
            }
          }
        }
      }
    }
  }
}
