---
schema_version: "1"
id: 228bad564bceac0293e607f13250521bc5e3e49fb14c063fc83d9498f44e4497
title: Upsert Partner Inventory Reconciliation Based on Partner Unsold Inventory Data
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/chrm-upsert-partner-inventory-rec.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.chrm-upsert-partner-inventory-rec.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 52e9d6df4d00eb17597f11bd7d828eb1da5e503cd2eec3b758adb8d43a3bea4e
description: The Upsert Partner Inventory Reconciliations Based on Unsold Inventory data processing engine (DPE) definition matches partner unsold inventories with partner inventory reconciliations. It creates and updates partner inventory reconciliations, partner inventory item reconciliations, and partner inventory item reconciliation traceabilities based on unsold inventory details in partner unsold inventory and partner unsold inventory ledgers. For valid partner staged data records used in the process, the status is updated to Processed.
products:
  - Partner Cloud
  - Cross Cloud
  - Manufacturing
release: "264"
---
# Upsert Partner Inventory Reconciliation Based on Partner Unsold Inventory Data

The Upsert Partner Inventory Reconciliations Based on Unsold Inventory data processing engine (DPE) definition matches partner unsold inventories with partner inventory reconciliations. It creates and updates partner inventory reconciliations, partner inventory item reconciliations, and partner inventory item reconciliation traceabilities based on unsold inventory details in partner unsold inventory and partner unsold inventory ledgers. For valid partner staged data records used in the process, the status is updated to Processed.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Professional</strong>, and <strong>Unlimited</strong> Editions with the Channel Revenue Management add on</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d21164e63">User Permissions Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d21164e63 ">To upsert partner inventory reconciliations</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d21164e63 ">Channel Partner Inventory Tracking Admin permission set</td>

          </tr>
        </tbody>
      </table>

Here are the high-level steps in the DPE template.

1. Get details of partner unsold inventory, partner unsold inventory ledger, partner inventory reconciliation, partner inventory item reconciliation, and partner inventory item reconciliation traceability records.
2. Filter partner unsold inventories and partner inventory item reconciliations that aren’t closed.
3. Calculate the quantity of partner unsold inventories with transaction dates that are on or before the related partner inventory reconciliations’ reported-as-of dates. Aggregate the credit and debit ledgers of the unsold inventories to get the quantity as on date.
4. Define matching criteria to match partner inventory item reconciliations and partner unsold inventories.
5. For partner inventory item reconciliations that don't match any partner unsold inventories based on their account, product, and unit price details, update the status of the item reconciliations to InProgress.
6. For partner unsold inventories without associated partner inventory item reconciliations, create partner inventory item reconciliation traceabilities with the quantities as on date as the unsold quantities. Create partner inventory item reconciliations with the Mismatch status by grouping the traceabilities by account, unit price, and product.
7. For partner unsold inventories with matching partner inventory item reconciliations, perform these operations.
    - For matching inventory item reconciliations without traceabilities, create traceabilities with the quantities as on date as the unsold quantities.
    - For matching inventory item reconciliations with traceabilities, update the unsold quantities of the traceabilities to the quantities as on date.
    - Check if the reported quantity and the total unsold quantity of the matching item reconciliations are the same. If they are, update the status of the inventory item reconciliations to Closed. If they are not, update the status to In Progress.