{
  "openapi" : "3.0.0",
  "info" : {
    "description" : "Product Storage Service API",
    "version" : "1.0.0",
    "title" : "Product Storage Service API",
    "contact" : {
      "email" : "ron@kovit.nl"
    },
    "license" : {
      "name" : "Apache 2.0",
      "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
    }
  },
  "tags" : [ {
    "name" : "admins",
    "description" : "Secured Admin-only calls"
  }, {
    "name" : "productstorage",
    "description" : "Operations available to service api users"
  } ],
  "paths" : {
    "/productdata" : {
      "get" : {
        "tags" : [ "productstorage" ],
        "summary" : "get product data for a product",
        "operationId" : "productdata",
        "description" : "Retrieve product data for one product",
        "parameters" : [ {
          "in" : "query",
          "name" : "supplierId",
          "required" : true,
          "description" : "pass an optional search string for looking up inventory",
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        }, {
          "in" : "query",
          "name" : "externalId",
          "required" : false,
          "description" : "external id of the productn to retrieve",
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "product list",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "object",
                  "$ref" : "#/components/schemas/Product"
                }
              }
            }
          },
          "400" : {
            "description" : "bad input parameter"
          }
        }
      },
      "delete" : {
        "tags" : [ "productstorage" ],
        "summary" : "deletes (deactivates) a product",
        "operationId" : "deleteProduct",
        "parameters" : [ {
          "in" : "query",
          "name" : "id",
          "required" : true,
          "description" : "Id of the product to delete",
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        } ],
        "responses" : {
          "201" : {
            "description" : "item removed"
          },
          "400" : {
            "description" : "invalid input, object invalid"
          }
        }
      },
      "post" : {
        "tags" : [ "productstorage" ],
        "summary" : "adds or updates a product",
        "operationId" : "updateProduct",
        "requestBody" : {
          "description" : "Adds an product to the system or update it when it already exists",
          "required" : true,
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/Product"
              }
            }
          }
        },
        "responses" : {
          "201" : {
            "description" : "item created/updated",
            "content" : {
              "text/plain" : {
                "schema" : {
                  "type" : "string",
                  "example" : "Product updated"
                }
              }
            }
          },
          "400" : {
            "description" : "invalid input, object invalid"
          }
        }
      }
    },
    "/customerproducts" : {
      "get" : {
        "tags" : [ "productstorage" ],
        "summary" : "updates all products available of a supplier, for a customer",
        "operationId" : "customerproducts",
        "parameters" : [ {
          "in" : "query",
          "name" : "customerId",
          "required" : true,
          "description" : "Id of the customer to retrieve the product list for",
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        } ],
        "responses" : {
          "201" : {
            "description" : "item created/updated",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "type" : "integer",
                    "format" : "int64"
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "invalid input, object invalid"
          }
        }
      }
    },
    "/supplierproducts" : {
      "get" : {
        "tags" : [ "productstorage" ],
        "summary" : "get product data for all products of a supplier",
        "operationId" : "supplierproducts",
        "description" : "Retrieve product data for all products of a supplier. This method is intended for use by the import services",
        "parameters" : [ {
          "in" : "query",
          "name" : "supplierId",
          "required" : true,
          "description" : "pass an optional search string for looking up inventory",
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "product list",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/Product"
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "bad input parameter"
          }
        }
      }
    },
    "/supplierunit" : {
      "get" : {
        "tags" : [ "productstorage" ],
        "summary" : "get a list of all supplier units",
        "operationId" : "supplierunits",
        "description" : "Retrieve product data for all products of a supplier. This method is intended for use by the import services",
        "parameters" : [ {
          "in" : "query",
          "name" : "supplierId",
          "required" : true,
          "description" : "Id of the supplier to retrieve all unit mappings",
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "unit list",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/SupplierUnit"
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "bad input parameter"
          }
        }
      },
      "post" : {
        "tags" : [ "productstorage" ],
        "summary" : "adds or updates a product",
        "operationId" : "updatesupplierunits",
        "requestBody" : {
          "description" : "Add or update a supplier unit mapping",
          "required" : true,
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/SupplierUnit"
              }
            }
          }
        },
        "responses" : {
          "201" : {
            "description" : "item created/updated",
            "content" : {
              "text/plain" : {
                "schema" : {
                  "type" : "string",
                  "example" : "Supplier unit updated"
                }
              }
            }
          },
          "400" : {
            "description" : "invalid input, object invalid"
          }
        }
      }
    },
    "/supplierunit/all" : {
      "get" : {
        "tags" : [ "productstorage" ],
        "summary" : "get a list of all supplier units",
        "operationId" : "allsupplierunits",
        "description" : "Retrieve product data for all products of a supplier. This method is intended for use by the import services",
        "parameters" : [ {
          "in" : "query",
          "name" : "supplierId",
          "required" : true,
          "description" : "Id of the supplier to retrieve all unit mappings",
          "schema" : {
            "type" : "integer",
            "format" : "int64"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "unit list",
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/SupplierUnit"
                  }
                }
              }
            }
          },
          "400" : {
            "description" : "bad input parameter"
          }
        }
      }
    }
  },
  "components" : {
    "schemas" : {
      "Product" : {
        "$ref" : "../../../../target/generated-sources/openapi/model/api/schemas/productschema.yaml"
      },
      "AllergenSpecification" : {
        "$ref" : "../../../../target/generated-sources/openapi/model/api/schemas/allergenspecification.yaml"
      },
      "SupplierUnit" : {
        "properties" : {
          "supplierunit" : {
            "properties" : {
              "code" : {
                "type" : "string",
                "description" : "Unit as known to the supplier"
              },
              "description" : {
                "type" : "string",
                "description" : "Description of the unit"
              }
            }
          },
          "kovitunit" : {
            "properties" : {
              "code" : {
                "type" : "string",
                "description" : "Unit as known to the supplier"
              },
              "description" : {
                "type" : "string",
                "description" : "Description of the unit"
              }
            }
          }
        }
      }
    }
  },
  "servers" : [ {
    "description" : "SwaggerHub API Auto Mocking",
    "url" : "https://virtserver.swaggerhub.com/rvdkruit/ProductStorageService/1.0.0"
  }, {
    "url" : "https://{environment}.kovit.nl:{port}/v1",
    "variables" : {
      "environment" : {
        "enum" : [ "test", "staging", "production" ],
        "default" : "test",
        "description" : "environment"
      },
      "port" : {
        "enum" : [ "443", "8443" ],
        "default" : "443"
      }
    }
  } ]
}