Configure Oracle Unity for Oracle Commerce

Before you can integrate Commercewith Oracle Unity, you need to configure both Oracle Unity and Oracle Commerce.

To obtain detailed information on the tasks described here, refer to the Oracle Unity documentation at https://docs.oracle.com/en/cloud/saas/cx-unity/books.html.

Integration Overview

Unity imports data from multiple systems into raw import tables. This raw data is moved into source data tables within the data warehouse, meaning that records from multiple sources are combined into a single source data table. Then a pipeline imports data from multiple sources into a master data table according to the rules that you have configured. By default, Unity uses the email field as the cluster key, although you can define any field, or set of field, as the key. Each cluster is linked to a single master record in a master entity and fields included in that master record are merged from the clustered source records. You can use the Customer 360 API to directly query source and the master tables.

You can then use the Commerce Admin API to map Commerce profile properties to the attributes of the Unity entities such as MasterCustomer and MasterAccount.

Note that there are two ways that your Commerce profile and account data are shared with Unity. When you initially set up your configuration, you should manually export all of the profile and account data form Commerce and import it into Unity. Once the integration is enabled and configured, an automated process will periodically export all Commerce profiles and accounts that have been updated and upload the export file to OOS.

Configure Unity components

The following describes how to configure Unity components so that they work with Oracle Commerce. These instructions describe exporting profiles and accounts from your Commerce instance and uploading those files to the Oracle Object Store (OOS). They also describe configuring a Unity data source to connect to the OOS, and then configuring a Unity ingest job to read files from the OOS. You will also need to incorporate Commerce Customer and Account records into the Unity mastering process and then run an ingestion pipeline.

Configure synchronization

Before you configure Unity components, it is recommended that you export your Profiles and Accounts to CSV files and upload the files to the Oracle Object Store. This allows you to configure an Ingest Job using your data. To do this use the Commerce Admin API and the exportProcess endpoint.

For detailed information on exporting data endpoints, refer to Export data endpoints.

When dynamically synchronizing profile and account data from Commerce to Unity, the OOS works as a data transfer repository. The integrator configures an OOS bucket that is accessible to both Commerce and Unity. It is recommended that you use a dedicated OOS bucket to transfer data between Commerce and Unity. Only a single bucket is required, and you can use the same bucket between manual bulk uploads, or for automated incremental uploads that the integration feature performs.

You should also create or identify a user that has permissions to manage objects in the OOS.

Next, you must upload the exported profile and account CSV files to the Oracle Object Storage (OOS). It is recommended that you use the same file name prefixes as used in the automatic incremental profile and account export, which are occs-profiles and occs-accounts. This allows you to use the same Unity data source and Ingest Job definition for both batch and any incremental imports.

Note: Because Unity does not provide a mechanism for removing files after ingestion, it is recommended that you implement an appropriate Object Lifecycle Management policy to eventually archive and/or delete these files. You must grant service permissions to the Object Storage Service so that OOS may archive and delete objects. For information on Object Lifecycle Management, refer to the Using Object Lifecycle Management section in the Unity documentation.

Commerce uploads incremental export files to the OOS through a pre-authenticated request (PAR) URL, which is configured by the integrator. For information on creating this URL, refer to Using pre-authenticated requests. You must configure the PAR to be write-only, with access to the appropriate bucket. OOS requires that you set an expiration date on the PAR. Note that when the PAR expires, the synchronization of Profiles and Accounts from Commerce to Unity will not work until you configure a new PAR.

Configure the Unity Ingestion Pipeline

When you configure a Unity Ingestion Pipeline, you are configuring how to import and manage the data in Unity, as well as selecting the source of the data that Unity uses. You are also configuring the way that data is provided to Unity and master rules that create clustering, augmentation, and promotions rules. Optionally, you can configure a Data Warehouse mapping.

For detailed information on configuring the Unity Ingestion Pipeline, refer to the Unity documentation.

Create Master Entities

Master Entities are data objects within the data model that store unified records. Commerce uses the default Master settings, which include the MasterCustomer and MasterAccount entities. However, if you would like to create a customized Master Entity, refer to Creating Master Entities in the Unity documentation. Configuring a Master Entity matches data across multiple sources and ensures that there is no duplication. Using the email field as the cluster key, records match when the first and last name match. Each cluster is linked to a single master record in a Master Entity, for example MasterCustomer. Fields included in the master record are merged from the clustered source records. Note that not all source fields are mapped into the master record

After you have created a Master Entity, you must publish your configuration changes using the Unity administration interface. For detailed information on publishing refer to Publishing changes in the Unity documentation.

Once you have published your changes, check your results to see if your account and customer tables require changes to the ingest configuration. After Unity has ingested data from multiple systems, it moves this data into source data tables within the data warehouse using the Unity Data Warehouse Job. The Data Warehouse Job copies ingested data from staging to the data warehouse and then runs data validation. Once the data has been verified, the data is inserted into the data model and, at this point, you can run the Identity Resource Job

The Identity Resolution Job calculates data density values that belong to Master Entities such as MasterCustomer. Data density represents the percentage of records that have values for an attribute. The Identity Resolution Job calculates data density values the first time it runs and then processes the data for the Master Entity. Once the density has initially been calculated, the job will calculate and refresh data density values for nine more times. Once it reaches the tenth job, the data values are calculated and refreshed every seven days. For information on data density and the refer to the Data Density section of the Unity documentation.

Configure a Data Source View

Commerce queries account and profile data using the Customer 360 API. The Customer 360 API cannot access the tables in the data warehouse directly, but instead uses a Data Source Views (DSV). The DSV joins together one or more source or master tables, and then selects the subset of fields that can be searched and returned from queries. Queries are run against a single Data Source View, which are generated by the Customer 360 job, and are run one at a time. Rules and subrules define how the DSV relate to each other. For detailed information on working with Customer 360 jobs, refer to the Customer 360 Concepts section of the Unity documentation.

The definitions include the following:
  • IDGraphRules - Contains a reference to a DSV object, and any defined subrules. Your searches specify which ID Graph Rule to search, as you can create multiple ID Graph Rules to return different data. For example, you might want to search different data records, such as customer or account data.
  • Subrules - Each subrule attaches more data to the IDGraph table for each record, and references its own DSV object, whose outputAttributes object represents the additional data available on the selected record. For example, use a subrule if you want to collect additional attributes. You can create multiple subrules and attach them to one ID Graph Rule so that you can initiate searches that return specific attributes. Note that each subrule must reference its own DSV, which allows you to search for fields related to the subrule and return related fields.
  • Data Source View (DSV) - The DSV specifies the attributes that are populated in the IDGraph table, as well as the attributes you can use when performing a search query and what is returned in the search results. DSVs must be referenced by the ID Graph Rule and each subrule within the ID Graph Rule.

For additional information on creating ID Graph Rules, subrules and DSVs, refer to this tutorial in the Unity documentation.

When you create the main DSV:
  • The main DSV is the DSV that is associated with the primary IDGraphRule object.
  • There are two outputAttributes with the DSV:
    • Inside operands objects, also known as inner outputAttributes objects - These are the column names that you specify after the SELECT keywords in an SQL query. You can select as many attributes as needed from the table, which is specified in the objectName object.
    • Inside MCPSQuery objects, also known as outer outputAttributes objects - To use attributes with this object, the attribute must be referenced before the inner outputAttributes object. The outer outputAttributes object in the IDGraphRule object specifies the attributes that you can search across and the attributes that are returned in the search results.

The following example shows how you would extract five attributes from the Customer table. This includes ID, SourceCustomerID, SourceID, Email and AccountID. These attributes are pulled from the inner outputAttributes object and then exposes those in the outer outputAttributes object. This allows you to search them and return search results.

Issue a POST command to {{Tenant URL}}/{{api-metadata_v1}}/{{MCPS Tenant Key}}/metadata/datasourceviews.

This is the example for the Profile DSV:
{
    "tenantId": 100052,
    "name": "OCC_Profile_DSV",
    "versionTS": 1611872531438,
    "active": true,
    "dataSourceViewID": "OCC_Profile_DSV",
    "sourceTableQuery": {
        "MCPSQuery": {
            "tenantId": 0,
            "operation": {
                "ctype": ".SetOperation",
                "tenantId": 0,
                "operands": [{
                        "ctype": ".ObjectSet",
                        "tenantId": 0,
                        "name": "c1",
                        "objectName": "Customer",
                        "outputAttributes": [{
                                "atype": ".ReferenceAttribute",
                                "tableName": "c1",
                                "attributeName": "ID"
                            },
                            {
                                "atype": ".ReferenceAttribute",
                                "tableName": "c1",
                                "attributeName": "SourceCustomerID"
                            },
                            {
                                "atype": ".ReferenceAttribute",
                                "tableName": "c1",
                                "attributeName": "SourceID"
                            },
                            {
                                "atype": ".ReferenceAttribute",
                                "tableName": "c1",
                                "attributeName": "Email"
                            },
                            {
                                "atype": ".ReferenceAttribute",
                                "tableName": "c1",
                                "attributeName": "AccountID"
                            }
                        ],
                        "distinct": false
                    },
                    null
                ],
                "operator": "INTERSECTION",
                "distinct": false,
                "outputAttributes": [{
                        "atype": ".ReferenceAttribute",
                        "tableName": "c1",
                        "attributeName": "ID"
                    },
                    {
                        "atype": ".ReferenceAttribute",
                        "tableName": "c1",
                        "attributeName": "SourceCustomerID"
                    },
                    {
                        "atype": ".ReferenceAttribute",
                        "tableName": "c1",
                        "attributeName": "SourceID"
                    },
                    {
                        "atype": ".ReferenceAttribute",
                        "tableName": "c1",
                        "attributeName": "Email"
                    },
                    {
                        "atype": ".ReferenceAttribute",
                        "tableName": "c1",
                        "attributeName": "AccountID"
                    }
                ],
                "joinConditions": []
            },
            "type": "DW"
        }
    }
}
The following example is for the Account DSV:
{
        "tenantId": 100052,
        "name": "OCC_Account_DSV",
        "versionTS": 1628229524814,
        "active": true,
        "lastModifiedBy": "fc524ec322dd4bdca13c06e6261cc725",
        "createdBy": "fc524ec322dd4bdca13c06e6261cc725",
        "createdTS": 1628229524814,
        "dataSourceViewID": "OCC_Account_DSV",
        "sourceTableQuery": {
            "MCPSQuery": {
                "tenantId": 0,
                "operation": {
                    "ctype": ".SetOperation",
                    "tenantId": 0,
                    "operands": [
                        {
                            "ctype": ".ObjectSet",
                            "tenantId": 0,
                            "name": "a1",
                            "objectName": "Account",
                            "outputAttributes": [
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "a1",
                                    "attributeName": "ID"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "a1",
                                    "attributeName": "SourceAccountID"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "a1",
                                    "attributeName": "SourceID"
                                }
                            ],
                            "distinct": false
                        },
                        null
                    ],
                    "operator": "INTERSECTION",
                    "distinct": false,
                    "outputAttributes": [
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "a1",
                            "attributeName": "ID"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "a1",
                            "attributeName": "SourceAccountID"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "a1",
                            "attributeName": "SourceID"
                        }
                    ],
                    "joinConditions": []
                },
                "type": "DW"
            }
        }
    }
    }
}

Create the subrule DSV

The subrule DSV contains properties similar to the main DSV.

  • The subrule DSV attaches additional data to the IDGraphRule object.
  • There are two outputAttributes with the subrule DSV
    • Inside operands objects, also known as inner outputAttributes objects - These are the column names that you specify after the SELECT keywords in an SQL query. You can select as many attributes as needed from the table, which is specified in the objectName object.
    • Inside MCPSQuery objects, also known as outer outputAttributes objects - To use attributes with this object, the attribute must be referenced before the inner outputAttributes object. The outer outputAttributes object in the IDGraphRule object specifies the attributes that you can search across and the attributes that are returned in the search results.

The following example of a subrule DSV shows how collect the data from two tables, the Customer (c1) and the MasterCustomer (m1) and then join them on the attribute ID.

Issue a POST command to {{Tenant URL}}/{{api-metadata_v1}}/{{MCPS Tenant Key}}/metadata/datasourceviews. The ID of the DSV is OCC_Profile_Subrule_DSV.

The following is an example of the Profile subrule DSV:

{
   "tenantId": 100052,
   "name": "OCC_Profile_Subrule_DSV",
   "versionTS": 1620369103427,
   "active": true,
   "lastModifiedBy": "fc524ec322dd4bdca13c06e6261cc725",
   "createdBy": "fc524ec322dd4bdca13c06e6261cc725",
   "createdTS": 1620369103427,
   "dataSourceViewID": "OCC_Profile_Subrule_DSV",
   "sourceTableQuery": {
       "MCPSQuery": {
           "tenantId": 0,
           "operation": {
               "ctype": ".SetOperation",
               "tenantId": 0,
               "operands": [{
                       "ctype": ".ObjectSet",
                       "tenantId": 0,
                       "name": "c1",
                       "objectName": "Customer",
                       "outputAttributes": [{
                               "atype": ".ReferenceAttribute",
                               "tableName": "c1",
                               "attributeName": "ID"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "c1",
                               "attributeName": "SourceCustomerID"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "c1",
                               "attributeName": "SourceID"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "c1",
                               "attributeName": "AccountID"
                           }
                       ],
                       "distinct": false
                   },
                   {
                       "ctype": ".ObjectSet",
                       "tenantId": 0,
                       "name": "m1",
                       "objectName": "MasterCustomer",
                       "outputAttributes": [{
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "ID"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "Email"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "FirstName"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "LastName"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "Age"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "Gender"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "AOV"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "City"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "Country"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "JobTitle"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "months_since_last_purchase"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "days_since_last_purchase"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "first_purchase_date"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "okToEmail"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "okToText"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "Phone"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "State"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "top_brand"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "top_product"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "top_product_category"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "total_order_count"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "total_purchase_count"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "total_return_count"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "total_spent_amt"
                           },
                           {
                               "atype": ".ReferenceAttribute",
                               "tableName": "m1",
                               "attributeName": "ZipCode"
                           }
                       ],
                       "distinct": false
                   }
               ],
               "operator": "INTERSECTION",
               "distinct": false,
               "outputAttributes": [{
                       "atype": ".ReferenceAttribute",
                       "tableName": "c1",
                       "attributeName": "ID"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "c1",
                       "attributeName": "SourceCustomerID"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "c1",
                       "attributeName": "SourceID"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "c1",
                       "attributeName": "AccountID"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "FirstName"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "LastName"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "Email"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "Age"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "Gender"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "AOV"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "City"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "Country"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "JobTitle"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "months_since_last_purchase"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "days_since_last_purchase"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "first_purchase_date"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "okToEmail"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "okToText"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "Phone"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "State"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "top_brand"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "top_product"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "top_product_category"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "total_order_count"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "total_purchase_count"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "total_return_count"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "total_spent_amt"
                   },
                   {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "ZipCode"
                   }
               ],
               "joinConditions": [{
                   "left": {
                       "atype": ".ReferenceAttribute",
                       "tableName": "c1",
                       "attributeName": "ID"
                   },
                   "right": {
                       "atype": ".ReferenceAttribute",
                       "tableName": "m1",
                       "attributeName": "ID"
                   }
               }]
           },
           "type": "DW"
       }
   }
}

The following is an example of an Account subrule DSV. Note that the account subrule DSV POST request does not contain a reference to the Account object because you are not referencing any attributes from that object. If you need to reference an attribute from an object in Unity, you would need to specify the object from which you would be referencing. As in the case of the Profile subrule DSV, you referenced the attributes from the Customer object as c1 and the MasterCustomer objects as m1.

{
        "tenantId": 100052,
        "name": "OCC_Account_Subrule_DSV",
        "versionTS": 1628229554895,
        "active": true,
        "lastModifiedBy": "fc524ec322dd4bdca13c06e6261cc725",
        "createdBy": "fc524ec322dd4bdca13c06e6261cc725",
        "createdTS": 1628229554895,
        "dataSourceViewID": "OCC_Account_Subrule_DSV",
        "sourceTableQuery": {
            "MCPSQuery": {
                "tenantId": 0,
                "operation": {
                    "ctype": ".SetOperation",
                    "tenantId": 0,
                    "operands": [
                        {
                            "ctype": ".ObjectSet",
                            "tenantId": 0,
                            "name": "m1",
                            "objectName": "MasterAccount",
                            "outputAttributes": [
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "m1",
                                    "attributeName": "ID"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "m1",
                                    "attributeName": "AddressLine1"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "m1",
                                    "attributeName": "AddressLine2"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "m1",
                                    "attributeName": "City"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "m1",
                                    "attributeName": "Country"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "m1",
                                    "attributeName": "Name"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "m1",
                                    "attributeName": "State"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "m1",
                                    "attributeName": "Type"
                                },
                                {
                                    "atype": ".ReferenceAttribute",
                                    "tableName": "m1",
                                    "attributeName": "ZipCode"
                                }
                            ],
                            "distinct": false
                        },
                        null
                    ],
                    "operator": "INTERSECTION",
                    "distinct": false,
                    "outputAttributes": [
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "m1",
                            "attributeName": "ID"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "m1",
                            "attributeName": "AddressLine1"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "m1",
                            "attributeName": "AddressLine2"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "m1",
                            "attributeName": "City"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "m1",
                            "attributeName": "Country"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "m1",
                            "attributeName": "Name"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "m1",
                            "attributeName": "State"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "m1",
                            "attributeName": "Type"
                        },
                        {
                            "atype": ".ReferenceAttribute",
                            "tableName": "m1",
                            "attributeName": "ZipCode"
                        }
                    ],
                    "joinConditions": []
                },
                "type": "DW"
            }
        }
    }

Create the IDGraphRule object

The IDGraphRule object is a lean JSON object that contains references to the DSV objects you created earlier. The subrules object may contain none or many IDGraphRules objects that act as subrules for that specific IDGraphRule.

Issue a POST command with an empty body to {{Tenant URL}}/{{api-metadata_v1}}/{{MCPS Tenant Key}}/metadata/idgraphrules. The ID of the IDGraphRuleObject is occ7.

The following is an example of the Profile IDGraphRule:
{
    "tenantId": 100052,
    "name": "occ7",
    "versionTS": 1611942055656,
    "active": true,
    "ruleId": "occ7",
    "inputDsvId": "OCC_Profile_DSV",
    "mainIdentifier": {
        "atype": ".DSVAttribute",
        "dsvId": "OCC_Profile_DSV",
        "attributeName": "ID"
    },
    "dedupeTargetId": "customer_mastercustomer",
    "subRules": [{
        "tenantId": 100052,
        "name": "OCC Profile Subrule",
        "versionTS": 1611790281085,
        "active": true,
        "ruleId": "occ7",
        "subRuleId": "OCC_Profile_Subrule",
        "masterEntity": true,
        "inputDsvId": "OCC_Profile_Subrule_DSV",
        "identifier": {
            "atype": ".DSVAttribute",
            "dsvId": "OCC_Profile_Subrule_DSV",
            "attributeName": "ID"
        },
        "maxRecords": 100
    }]
}

The following is an example of the Account IDGraphRule:

{
        "tenantId": 100052,
        "name": "occ9",
        "versionTS": 1628299175767,
        "active": true,
        "lastModifiedBy": "fc524ec322dd4bdca13c06e6261cc725",
        "createdBy": "fc524ec322dd4bdca13c06e6261cc725",
        "createdTS": 1628299175767,
        "ruleId": "occ9",
        "inputDsvId": "OCC_Account_DSV",
        "mainIdentifier": {
            "atype": ".DSVAttribute",
            "dsvId": "OCC_Account_DSV",
            "attributeName": "ID"
        },
        "dedupeTargetId": "account_masteraccount",
        "subRules": [
            {
                "tenantId": 100052,
                "name": "OCC Account Subrule",
                "versionTS": 1628229619713,
                "active": true,
                "createdTS": 1628229619713,
                "ruleId": "occ9",
                "subRuleId": "OCC_Account_Subrule",
                "masterEntity": true,
                "inputDsvId": "OCC_Account_Subrule_DSV",
                "identifier": {
                    "atype": ".DSVAttribute",
                    "dsvId": "OCC_Account_Subrule_DSV",
                    "attributeName": "ID"
                },
                "maxRecords": 100
            }
        ]
    }

Run a Publish Job

Note that all metadata, including the Ingest Job, the Master Entities, the DSV and the 360 rule definitions, must go through the publishing process and changes must be promoted before taking effect.

Once you have created all of the objects, you publish them by running a Publish Job. To do this issue a POST command with an empty body to {{Tenant URL}}/api-admin/v1/{{MCPS Tenant Key}}/admin/tenant/publish. This initiates a Publish Job that you can track using the Jobs page. This job usually takes up to ten minutes to complete.

For information on Publishing Jobs, refer to Data Publishing section in the Unity documentation.

Run a Customer 360 Job

Once the Publish Job has completed, you must run a Customer 360 Job. This job ensures that you get the search results that you expected. To do this, issue POST command with an empty body to {{Tenant URL}}/api-admin/v1/{{MCPS Tenant Key}}/admin/job/IDGRAPH/IdGraph/start. Once the Customer 360 Job has completed, you can search customer data.

For information on working with Customer 360 Jobs, refer to the Customer 360 Jobs Unity documentation.