Migrate Entity Data

You can migrate a large set of records of various entities from one system to the Buying system using the bulk migration APIs. Currently, the following TMF entities are supported:

  • Party
  • Customer
  • PartyAccount
  • Product (Asset)
Here are some points to consider before you get started with the bulk migration task:
  1. You must be a Bulk Job Administrator to perform this task. You must integrate Buying Experience with Oracle Content Management (OCM). For details, see Integration with Other Applications chapter in this guide.
  2. Create a folder in Oracle Content Management (which will act as the parent migration folder) for storing the migration data files. You can then add the confidential application that you created in the Oracle Identity Cloud Service as a Downloader or Owner for the download access.

Bulk migration of existing subscriber data is implemented using the following approach involving two steps:

  • The first step is called createJob where the JSON data is read from Oracle Content Management (OCM) and inserted into a staging table.
  • The second step is called processJob where it reads the data from staging table and migrates to Buying system.

As a prerequisite, party account migration is required to be completed in order to migrate the asset data corresponding to the given account. The JSON files for migration of entity data can be placed in any directory.

You can use the createJob POST API to submit the job to perform the first step. It will return the response with jobId. You can invoke the GET API by using the jobId to track whether the job is in progress, is successful, or is in error. By using the GET API, you can monitor the job status. After the job is successful, you can run the processJob POST API to migrate the data. Here again, you can use the GET API to get the status. If any of the jobs fail, you can use the error GET API to see the error message.

  1. Call the createJob API using the input payload provided in the Buying Experience REST API guide. You can run this cURL command or use a REST API client to call the createJob API:
    curl -H 'Authorization: Bearer <accessToken>' https://<hostName>/cx/industry/buying/bulk-api/v1/migration/createJob -X POST -H "Content-Type: application/json"
    Your payload must contain the directory ID. Here's the sample payload for the create job API:
    {
        "id": "FF6C2D52A0BFE87B52829F13EB2",  OCE folder Id
        "entityName": "Product"  name of the entity
    }
    
  2. Call the processJob API using the jobId that you have from the Step 1. You can run this cURL command or use a REST API client to call the processJob API:
    curl -H 'Authorization: Bearer <accessToken>' https://<hostName>/cx/industry/buying/bulk-api/v1/migration/<jobId>/processJob -X POST -H "Content-Type: application/json"

    To view the status of the job:

    Call the GET API using the jobId that you have from the Step 1 or Step 2. You can run this cURL command or use a REST API client to call the GET API:

    curl -H 'Authorization: Bearer <accessToken>' https://<hostName>/cx/industry/buying/bulk-api/v1/migration/<jobId> -X GET

    To view the error details in case if the job fails:

    Call the GET API using the jobId that you have from the Step 1 or Step 2. You can run this cURL command or use a REST API client to call the error API:

    curl -H 'Authorization: Bearer <accessToken>' https://<hostName>/cx/industry/buying/bulk-api/v1/migration/{jobId}/error -X GET

After these entity data are migrated into Buying, it's possible to transact on these data for various operations from Buying.