diff --git a/inc/post_code.hpp b/inc/post_code.hpp
index 5e2a7b9..05ce284 100644
--- a/inc/post_code.hpp
+++ b/inc/post_code.hpp
@@ -21,6 +21,7 @@
 #include <cereal/archives/json.hpp>
 #include <cereal/cereal.hpp>
 #include <cereal/types/map.hpp>
+#include <cereal/types/tuple.hpp>
 #include <cereal/types/vector.hpp>
 #include <chrono>
 #include <experimental/filesystem>
@@ -76,6 +77,9 @@
     }
 };
 using EventPtr = std::unique_ptr<sd_event, EventDeleter>;
+using primarycode_t = uint64_t;
+using secondarycode_t = std::vector<uint8_t>;
+using postcode_t = std::tuple<primarycode_t, secondarycode_t>;
 namespace fs = std::experimental::filesystem;
 namespace StateServer = sdbusplus::xyz::openbmc_project::State::server;
 
@@ -102,7 +106,7 @@
                     postcodeDataHolderObj->PropertiesIntf),
             [this](sdbusplus::message::message &msg) {
                 std::string objectName;
-                std::map<std::string, std::variant<uint64_t>> msgData;
+                std::map<std::string, std::variant<postcode_t>> msgData;
                 msg.read(objectName, msgData);
                 // Check if it was the Value property that changed.
                 auto valPropMap = msgData.find("Value");
@@ -110,7 +114,7 @@
                     if (valPropMap != msgData.end())
                     {
                         this->savePostCodes(
-                            std::get<uint64_t>(valPropMap->second));
+                            std::get<postcode_t>(valPropMap->second));
                     }
                 }
             }),
@@ -179,8 +183,8 @@
     {
     }
 
-    std::vector<uint64_t> getPostCodes(uint16_t index) override;
-    std::map<uint64_t, uint64_t>
+    std::vector<postcode_t> getPostCodes(uint16_t index) override;
+    std::map<uint64_t, postcode_t>
         getPostCodesWithTimeStamp(uint16_t index) override;
     void deleteAll() override;
 
@@ -191,16 +195,16 @@
     sdbusplus::bus::bus &bus;
     std::chrono::time_point<std::chrono::steady_clock> firstPostCodeTimeSteady;
     uint64_t firstPostCodeUsSinceEpoch;
-    std::map<uint64_t, uint64_t> postCodes;
+    std::map<uint64_t, postcode_t> postCodes;
     std::string strPostCodeListPath;
     std::string strCurrentBootCycleIndexName;
     uint16_t currentBootCycleIndex;
     std::string strCurrentBootCycleCountName;
-    void savePostCodes(uint64_t code);
+    void savePostCodes(postcode_t code);
     sdbusplus::bus::match_t propertiesChangedSignalRaw;
     sdbusplus::bus::match_t propertiesChangedSignalCurrentHostState;
     fs::path serialize(const std::string &path);
     bool deserialize(const fs::path &path, uint16_t &index);
     bool deserializePostCodes(const fs::path &path,
-                              std::map<uint64_t, uint64_t> &codes);
+                              std::map<uint64_t, postcode_t> &codes);
 };
diff --git a/src/post_code.cpp b/src/post_code.cpp
index d0ba711..88035c5 100644
--- a/src/post_code.cpp
+++ b/src/post_code.cpp
@@ -34,9 +34,9 @@
     currentBootCycleCount(1);
 }
 
-std::vector<uint64_t> PostCode::getPostCodes(uint16_t index)
+std::vector<postcode_t> PostCode::getPostCodes(uint16_t index)
 {
-    std::vector<uint64_t> codesVec;
+    std::vector<postcode_t> codesVec;
     if (1 == index && !postCodes.empty())
     {
         for (auto& code : postCodes)
@@ -49,13 +49,14 @@
         decltype(postCodes) codes;
         deserializePostCodes(
             fs::path(strPostCodeListPath + std::to_string(bootNum)), codes);
-        for (std::pair<uint64_t, uint64_t> code : codes)
+        for (std::pair<uint64_t, postcode_t> code : codes)
             codesVec.push_back(code.second);
     }
     return codesVec;
 }
 
-std::map<uint64_t, uint64_t> PostCode::getPostCodesWithTimeStamp(uint16_t index)
+std::map<uint64_t, postcode_t>
+    PostCode::getPostCodesWithTimeStamp(uint16_t index)
 {
     if (1 == index && !postCodes.empty())
     {
@@ -69,7 +70,7 @@
     return codes;
 }
 
-void PostCode::savePostCodes(uint64_t code)
+void PostCode::savePostCodes(postcode_t code)
 {
     // steady_clock is a monotonic clock that is guaranteed to never be adjusted
     auto postCodeTimeSteady = std::chrono::steady_clock::now();
@@ -158,7 +159,7 @@
 }
 
 bool PostCode::deserializePostCodes(const fs::path& path,
-                                    std::map<uint64_t, uint64_t>& codes)
+                                    std::map<uint64_t, postcode_t>& codes)
 {
     try
     {
