{
  "openapi": "3.0.1",
  "info": {
    "title": "Products API",
    "version": "v2"
  },
  "servers": [
    {
      "url": "https://api-playground.loady.com/public/products/v2"
    }
  ],
  "paths": {
    "/{productId}": {
      "get": {
        "tags": [],
        "summary": "Get product by id",
        "description": "Endpoint provides possibility to get product's information.",
        "operationId": "get-product-v2",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "description": "Id of Product",
            "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": "Found Product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/publicProductDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      },
      "put": {
        "tags": [],
        "summary": "Update product",
        "description": "Update product",
        "operationId": "put-product-v2",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "description": "Id of Product",
            "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"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updatePublicProductDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Success"
          },
          "400": {
            "description": "The request sent by the client is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/innerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      },
      "delete": {
        "tags": [],
        "summary": "Delete product",
        "description": "Delete product",
        "operationId": "delete-product-v1",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "description": "Id of Product",
            "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": {
          "204": {
            "description": "Success"
          },
          "400": {
            "description": "The request sent by the client is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/innerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      }
    },
    "/": {
      "get": {
        "tags": [],
        "summary": "Get product by reference number",
        "description": "Endpoint provides possibility to get product's information.",
        "operationId": "get-product-by-reference-number-v2",
        "parameters": [
          {
            "name": "referenceNumber",
            "in": "query",
            "description": "Reference Number of Product",
            "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": "Found Product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/publicProductDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      },
      "post": {
        "tags": [],
        "summary": "Create product",
        "description": "Endpoint provides the possibility to create a product",
        "operationId": "create-product-v2",
        "parameters": [
          {
            "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/createPublicProductDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created product",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/publicProductDto"
                }
              }
            }
          },
          "400": {
            "description": "The request sent by the client is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/innerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      },
      "put": {
        "tags": [],
        "summary": "Update product by reference number",
        "description": "Update product by reference number",
        "operationId": "put-product-by-reference-number-v2",
        "parameters": [
          {
            "name": "referenceNumber",
            "in": "query",
            "description": "Reference Number of Product",
            "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"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/updatePublicProductDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Success"
          },
          "400": {
            "description": "The request sent by the client is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/innerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      },
      "delete": {
        "tags": [],
        "summary": "Delete product by reference number",
        "description": "Delete product by reference number",
        "operationId": "delete-product-by-reference-number-v1",
        "parameters": [
          {
            "name": "referenceNumber",
            "in": "query",
            "description": "Reference Number of Product",
            "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": {
          "204": {
            "description": "Success"
          },
          "400": {
            "description": "The request sent by the client is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/innerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "LoadyOAuth": [],
            "SubscriptionKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "adrClassificationDto": {
        "type": "object",
        "properties": {
          "unNumber": {
            "type": "string"
          },
          "properShippingName": {
            "type": "string"
          },
          "hazardInducer": {
            "type": "string"
          },
          "classOrDivision": {
            "type": "string"
          },
          "packingGroup": {
            "type": "string"
          },
          "environmentalHazards": {
            "type": "boolean",
            "nullable": true
          },
          "subsidiaryHazards": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          }
        }
      },
      "createPublicProductDto": {
        "type": "object",
        "properties": {
          "productType": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "referenceNumber": {
            "type": "string"
          },
          "authorizationGroup": {
            "type": "string"
          },
          "tradeNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "synonyms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ecNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "casNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mixture": {
            "type": "boolean",
            "nullable": true
          },
          "adrClassification": {
            "$ref": "#/components/schemas/adrClassificationDto"
          },
          "temperatureRequirements": {
            "$ref": "#/components/schemas/publicProductTemperatureRequirementsDto"
          },
          "physicalAndChemicalParameters": {
            "$ref": "#/components/schemas/physicalAndChemicalParametersDto"
          }
        }
      },
      "dayMonthDto": {
        "type": "object",
        "properties": {
          "day": {
            "type": "integer",
            "format": "int32"
          },
          "month": {
            "type": "integer",
            "format": "int32"
          }
        }
      },
      "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"
          }
        }
      },
      "physicalAndChemicalParametersDto": {
        "type": "object",
        "properties": {
          "densityUnit": {
            "type": "string"
          },
          "density": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "freezingPointUnit": {
            "enum": [
              "None",
              "Celsius",
              "Fahrenheit",
              "Cel",
              "Fah"
            ],
            "type": "string",
            "default": "None"
          },
          "freezingPoint": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "flashPointUnit": {
            "enum": [
              "None",
              "Celsius",
              "Fahrenheit",
              "Cel",
              "Fah"
            ],
            "type": "string",
            "default": "None"
          },
          "flashPoint": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "waterSolubility": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "waterSolubilityUnit": {
            "enum": [
              "None",
              "GramsPerLitre",
              "PoundsPerGallon"
            ],
            "type": "string",
            "default": "None"
          }
        }
      },
      "publicProductDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "productType": {
            "type": "string"
          },
          "companyId": {
            "type": "string"
          },
          "companyReferenceNumber": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "referenceNumber": {
            "type": "string"
          },
          "authorizationGroup": {
            "type": "string"
          },
          "tradeNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "synonyms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ecNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "casNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mixture": {
            "type": "boolean",
            "nullable": true
          },
          "adrClassification": {
            "$ref": "#/components/schemas/adrClassificationDto"
          },
          "temperatureRequirements": {
            "$ref": "#/components/schemas/publicProductTemperatureRequirementsDto"
          },
          "physicalAndChemicalParameters": {
            "$ref": "#/components/schemas/physicalAndChemicalParametersDto"
          }
        }
      },
      "publicProductTemperatureRequirementsDto": {
        "type": "object",
        "properties": {
          "maxContactTemperatureUnit": {
            "enum": [
              "None",
              "Celsius",
              "Fahrenheit",
              "Cel",
              "Fah"
            ],
            "type": "string",
            "default": "None"
          },
          "maxContactTemperature": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "transportTemperatureUnit": {
            "enum": [
              "None",
              "Celsius",
              "Fahrenheit",
              "Cel",
              "Fah"
            ],
            "type": "string",
            "default": "None"
          },
          "transportTemperature": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/publicTransportTemperatureEntryDto"
            }
          }
        }
      },
      "publicTransportTemperatureEntryDto": {
        "type": "object",
        "properties": {
          "minimumTransportTemperature": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "maximumTransportTemperature": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "validFrom": {
            "$ref": "#/components/schemas/dayMonthDto"
          },
          "validTo": {
            "$ref": "#/components/schemas/dayMonthDto"
          }
        }
      },
      "updatePublicProductDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "referenceNumber": {
            "type": "string"
          },
          "authorizationGroup": {
            "type": "string"
          },
          "tradeNames": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "synonyms": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ecNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "casNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "mixture": {
            "type": "boolean",
            "nullable": true
          },
          "adrClassification": {
            "$ref": "#/components/schemas/adrClassificationDto"
          },
          "temperatureRequirements": {
            "$ref": "#/components/schemas/publicProductTemperatureRequirementsDto"
          },
          "physicalAndChemicalParameters": {
            "$ref": "#/components/schemas/physicalAndChemicalParametersDto"
          }
        }
      }
    },
    "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"
            }
          }
        }
      }
    }
  }
}
