code: def _find_or_create_version(self, product):
          
          tag = self.options["tag"]
  
          label = self.project_config.get_version_for_tag(tag)
          result = self._call_api(
              "GET", "/versions", params={"product": product["id"], "label": label}
          )
          if len(result["data"]) == 0:
              version = self._call_api(
                  "POST",
                  "/versions",
                  json={
                      "product": product["url"],
                      "label": label,
                      "description": self.options.get("description", ""),
                      "is_production": True,
                      "commit_ish": tag,
                      "is_listed": False,
                  },
              )
              self.logger.info("Created {}".format(version["url"]))
          else:
              version = result["data"][0]
              self.logger.info("Found {}".format(version["url"]))
          return version
docs: Create a Version in MetaDeploy if it doesn't already exist