diff --git a/vendor/magento/module-sales-archive/Model/ResourceModel/Archive.php b/vendor/magento/module-sales-archive/Model/ResourceModel/Archive.php
index 31d3a9f81fbf..60c231465c72 100644
--- a/vendor/magento/module-sales-archive/Model/ResourceModel/Archive.php
+++ b/vendor/magento/module-sales-archive/Model/ResourceModel/Archive.php
@@ -35,6 +35,7 @@ class Archive extends EntityAbstract
      *
      * @var $_tables array
      * @deprecated 100.3.1
+     * @see $tableMapper TableMapper
      */
     protected $_tables = [
         \Magento\SalesArchive\Model\ArchivalList::ORDER => [
@@ -56,7 +57,7 @@ class Archive extends EntityAbstract
     ];
 
     /**
-     * Sales archive config
+     * Config for sales archive
      *
      * @var Config
      */
@@ -118,6 +119,7 @@ public function __construct(
      * Model initialization
      *
      * @return void
+     * phpcs:disable Magento2.CodeAnalysis.EmptyBlock
      */
     protected function _construct()
     {
@@ -173,9 +175,10 @@ public function isOrderInArchive($id)
      *
      * @param string $archiveEntity
      * @param array|int $ids
+     * @param string $conditionalField
      * @return array
      */
-    public function getIdsInArchive($archiveEntity, $ids)
+    public function getIdsInArchive($archiveEntity, $ids, $conditionalField = 'entity_id')
     {
         if (!$this->isArchiveEntityExists($archiveEntity) || empty($ids)) {
             return [];
@@ -189,7 +192,7 @@ public function getIdsInArchive($archiveEntity, $ids)
             $this->getArchiveEntityTable($archiveEntity),
             'entity_id'
         )->where(
-            'entity_id IN(?)',
+            $conditionalField . ' IN(?)',
             $ids
         );
 
@@ -406,7 +409,8 @@ public function removeOrdersFromArchiveById($orderIds)
 
                 $entityIds = $this->getIdsInArchive(
                     $entity,
-                    $orderIds
+                    $orderIds,
+                    $conditionalField
                 );
 
                 if (!empty($entityIds)) {
