diff --git a/platform-mc/terminus.hpp b/platform-mc/terminus.hpp
index 1986da0..e818d32 100644
--- a/platform-mc/terminus.hpp
+++ b/platform-mc/terminus.hpp
@@ -111,6 +111,24 @@
         return true;
     }
 
+    /** @brief Set the PLDM supported type version for terminus
+     *
+     *  @param[in] type - PLDM supported types
+     *  @param[in] version - PLDM supported type version
+     *  @return success state - True if success, otherwise False
+     */
+    inline bool setSupportedTypeVersions(const uint8_t type,
+                                         const ver32_t version)
+    {
+        if (type > PLDM_MAX_TYPES || type >= supportedTypeVersions.size())
+        {
+            return false;
+        }
+        supportedTypeVersions[type] = version;
+
+        return true;
+    }
+
     /** @brief Parse the PDRs stored in the member variable, pdrs.
      */
     void parseTerminusPDRs();
@@ -267,6 +285,9 @@
      */
     std::vector<uint8_t> supportedCmds;
 
+    /* @brief The PLDM supported type version */
+    std::map<uint8_t, ver32_t> supportedTypeVersions;
+
     /* @brief Sensor Auxiliary Name list */
     std::vector<std::shared_ptr<SensorAuxiliaryNames>>
         sensorAuxiliaryNamesTbl{};
diff --git a/platform-mc/terminus_manager.cpp b/platform-mc/terminus_manager.cpp
index 10adefd..7565ee2 100644
--- a/platform-mc/terminus_manager.cpp
+++ b/platform-mc/terminus_manager.cpp
@@ -352,8 +352,18 @@
             type++;
             continue;
         }
+
+        ver32_t version{0xFF, 0xFF, 0xFF, 0xFF};
+        auto rc = co_await getPLDMVersion(tid, type, &version);
+        if (rc)
+        {
+            lg2::error(
+                "Failed to Get PLDM Version for terminus {TID}, PLDM Type {TYPE}, error {ERROR}",
+                "TID", tid, "TYPE", type, "ERROR", rc);
+        }
+        termini[tid]->setSupportedTypeVersions(type, version);
         std::vector<bitfield8_t> cmds(PLDM_MAX_CMDS_PER_TYPE / 8);
-        auto rc = co_await getPLDMCommands(tid, type, cmds.data());
+        rc = co_await getPLDMCommands(tid, type, version, cmds.data());
         if (rc)
         {
             lg2::error(
@@ -538,12 +548,11 @@
     co_return completionCode;
 }
 
-exec::task<int> TerminusManager::getPLDMCommands(pldm_tid_t tid, uint8_t type,
-                                                 bitfield8_t* supportedCmds)
+exec::task<int> TerminusManager::getPLDMCommands(
+    pldm_tid_t tid, uint8_t type, ver32_t version, bitfield8_t* supportedCmds)
 {
     Request request(sizeof(pldm_msg_hdr) + PLDM_GET_COMMANDS_REQ_BYTES);
     auto requestMsg = reinterpret_cast<pldm_msg*>(request.data());
-    ver32_t version{0xFF, 0xFF, 0xFF, 0xFF};
 
     auto rc = encode_get_commands_req(0, type, version, requestMsg);
     if (rc)
@@ -627,5 +636,58 @@
     co_return rc;
 }
 
+exec::task<int> TerminusManager::getPLDMVersion(pldm_tid_t tid, uint8_t type,
+                                                ver32_t* version)
+{
+    Request request(sizeof(pldm_msg_hdr) + PLDM_GET_VERSION_REQ_BYTES);
+    auto requestMsg = new (request.data()) pldm_msg;
+
+    auto rc =
+        encode_get_version_req(0, 0, PLDM_GET_FIRSTPART, type, requestMsg);
+    if (rc)
+    {
+        lg2::error(
+            "Failed to encode request getPLDMVersion for terminus ID {TID}, error {RC} ",
+            "TID", tid, "RC", rc);
+        co_return rc;
+    }
+
+    const pldm_msg* responseMsg = nullptr;
+    size_t responseLen = 0;
+
+    rc = co_await sendRecvPldmMsg(tid, request, &responseMsg, &responseLen);
+    if (rc)
+    {
+        lg2::error(
+            "Failed to send getPLDMVersion message for terminus {TID}, error {RC}",
+            "TID", tid, "RC", rc);
+        co_return rc;
+    }
+
+    /* Process response */
+    uint8_t completionCode = 0;
+    uint8_t transferFlag = 0;
+    uint32_t transferHandle = 0;
+    rc = decode_get_version_resp(responseMsg, responseLen, &completionCode,
+                                 &transferHandle, &transferFlag, version);
+    if (rc)
+    {
+        lg2::error(
+            "Failed to decode response getPLDMVersion for terminus ID {TID}, error {RC} ",
+            "TID", tid, "RC", rc);
+        co_return rc;
+    }
+
+    if (completionCode != PLDM_SUCCESS)
+    {
+        lg2::error(
+            "Error : getPLDMVersion for terminus ID {TID}, complete code {CC}.",
+            "TID", tid, "CC", completionCode);
+        co_return completionCode;
+    }
+
+    co_return completionCode;
+}
+
 } // namespace platform_mc
 } // namespace pldm
diff --git a/platform-mc/terminus_manager.hpp b/platform-mc/terminus_manager.hpp
index 2103fc5..8b7cd15 100644
--- a/platform-mc/terminus_manager.hpp
+++ b/platform-mc/terminus_manager.hpp
@@ -201,16 +201,29 @@
      */
     exec::task<int> getPLDMTypes(pldm_tid_t tid, uint64_t& supportedTypes);
 
+    /** @brief Send getPLDMVersion command to destination TID and then return
+     *         the version of the PLDM supported type.
+     *
+     *  @param[in] tid - Destination TID
+     *  @param[in] type - PLDM Type
+     *  @param[out] version - PLDM Type version
+     *  @return coroutine return_value - PLDM completion code
+     */
+    exec::task<int> getPLDMVersion(pldm_tid_t tid, uint8_t type,
+                                   ver32_t* version);
+
     /** @brief Send getPLDMCommands command to destination TID and then return
      *         the value of supportedCommands in reference parameter.
      *
      *  @param[in] tid - Destination TID
      *  @param[in] type - PLDM Type
+     *  @param[in] version - PLDM Type version
      *  @param[in] supportedCmds - Supported commands returned from terminus
      *                             for specific type
      *  @return coroutine return_value - PLDM completion code
      */
     exec::task<int> getPLDMCommands(pldm_tid_t tid, uint8_t type,
+                                    ver32_t version,
                                     bitfield8_t* supportedCmds);
 
     /** @brief Reference to a Handler object that manages the request/response
diff --git a/platform-mc/test/terminus_manager_test.cpp b/platform-mc/test/terminus_manager_test.cpp
index 6c425f2..7fa8506 100644
--- a/platform-mc/test/terminus_manager_test.cpp
+++ b/platform-mc/test/terminus_manager_test.cpp
@@ -302,6 +302,9 @@
     const size_t setTidRespLen = PLDM_SET_TID_RESP_BYTES;
     const size_t getPldmTypesRespLen = PLDM_GET_TYPES_RESP_BYTES;
     const size_t getPldmCommandRespLen = PLDM_GET_COMMANDS_RESP_BYTES;
+    /* PLDM_GET_VERSION_RESP_BYTES does not include 4 bytes check sum */
+    const size_t getPldmVersionRespLen =
+        PLDM_GET_VERSION_RESP_BYTES + sizeof(uint32_t);
 
     // 0.discover a mctp list
     auto rc = mockTerminusManager.clearQueuedResponses();
@@ -329,6 +332,17 @@
         sizeof(getPldmTypesResp0));
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
+    /* Response GetPLDMVersion BASE, CC=0 */
+    std::array<uint8_t, sizeof(pldm_msg_hdr) + getPldmVersionRespLen>
+        getPldmVersionBaseResp0{0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+                                0x00, 0x00, 0x05, 0x00, 0xf0, 0xf1,
+                                0xf1, 0xba, 0xbe, 0x9d, 0x53};
+
+    rc = mockTerminusManager.enqueueResponse(
+        (pldm_msg*)getPldmVersionBaseResp0.data(),
+        sizeof(getPldmVersionBaseResp0));
+    EXPECT_EQ(rc, PLDM_SUCCESS);
+
     /* Response GetPLDMCommand BASE, CC=0,
      * SetTID/GetTID/GetPLDMTypes/GetPLDMCommands */
     byte0 = (1 << (PLDM_SET_TID % 8)) + (1 << (PLDM_GET_TID % 8)) +
@@ -345,6 +359,16 @@
         sizeof(getPldmCommandBaseResp0));
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
+    /* Response GetPLDMVersion PLATFORM, CC=0 */
+    std::array<uint8_t, sizeof(pldm_msg_hdr) + getPldmVersionRespLen>
+        getPldmVersionPlatformResp0{0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+                                    0x00, 0x00, 0x05, 0x00, 0xf1, 0xf2,
+                                    0xf1, 0x4e, 0x87, 0x72, 0x79};
+
+    rc = mockTerminusManager.enqueueResponse(
+        (pldm_msg*)getPldmVersionPlatformResp0.data(),
+        sizeof(getPldmVersionPlatformResp0));
+    EXPECT_EQ(rc, PLDM_SUCCESS);
     /* Response GetPLDMCommand PLATFORM, CC=0,
      * SetEventReceiver/PlatformEventMessage/GetSensorReading/SetNumericEffecterValue/GetNumericEffecterValue/GetPDR
      */
@@ -383,6 +407,16 @@
         sizeof(getPldmCommandPlatResp0));
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
+    /* Response GetPLDMVersion BIOS, CC=0 */
+    std::array<uint8_t, sizeof(pldm_msg_hdr) + getPldmVersionRespLen>
+        getPldmVersionBiosResp0{0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+                                0x00, 0x00, 0x05, 0x00, 0xf0, 0xf0,
+                                0xf1, 0xfb, 0x8f, 0x86, 0x4a};
+
+    rc = mockTerminusManager.enqueueResponse(
+        (pldm_msg*)getPldmVersionBiosResp0.data(),
+        sizeof(getPldmVersionBiosResp0));
+    EXPECT_EQ(rc, PLDM_SUCCESS);
     /* Response GetPLDMCommand BIOS, CC=0, GetDateTime/SetDateTime */
     /* byte0 command from 1 to 7 */
     byte0 = (0 << (PLDM_GET_BIOS_TABLE % 8)) +
@@ -402,6 +436,16 @@
         sizeof(getPldmCommandBiosResp0));
     EXPECT_EQ(rc, PLDM_SUCCESS);
 
+    /* Response GetPLDMVersion FRU, CC=0 */
+    std::array<uint8_t, sizeof(pldm_msg_hdr) + getPldmVersionRespLen>
+        getPldmVersionFruResp0{0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
+                               0x00, 0x00, 0x05, 0x00, 0xf1, 0xf0,
+                               0xf1, 0xcc, 0xe5, 0x44, 0x4b};
+
+    rc = mockTerminusManager.enqueueResponse(
+        (pldm_msg*)getPldmVersionFruResp0.data(),
+        sizeof(getPldmVersionFruResp0));
+    EXPECT_EQ(rc, PLDM_SUCCESS);
     /* Response GetPLDMCommand FRU, CC=0,
      * GetFRURecordTableMetadata/GetFRURecordTable */
     /* byte0 command from 1 to 7 */
