Importing base catalog sample data

This procedure shows how to import Base catalog sample data, such as catologs, categories, items, and attributes.

Before you begin

  • Make sure that the sample data.ZIP file is downloaded and accessible. The ZIP file contains 13 CSV files that can be loaded together. You can also load the individual CSV files separately.
  • Ensure a REST API tool of your choice (for example, Postman or Swagger) is installed and available on your machine. You’ll use this tool to import the sample data.
  • Catalog administrator can execute this transaction.

About this task

When item service integration is enabled, the catalog service sends newly imported product part numbers to the item service. item service converts these part numbers into unique item identifiers. The catalog service takes over to store the relationship, saving the product_id to item_id mapping in the item_product table.

This sample data loads the following content:

  • Attribute
  • Attribute-description
  • Attribute-value
  • Base-catalog
  • Category
  • Category-description
  • Category-digital-asset
  • Product
  • Product-association
  • Product-attribute
  • Product description
  • Product-digital-asset
  • Product-relationship

Importing and verifying the sample data

Procedure

To import base catalog sample data:
  1. Use the following REST API endpoint to import base catalog sample data CSV files. Set the content type to multipart/form-data.
    POST https://hostname:port/catalog/api/admin/v1/data-jobs/import
  2. Provide the following details inside your API request envelope:
    Parameter Description
    workspaceId The target deployment boundary workspace ID.
    catalogIdentifier The explicit base catalog destination label. You can omit this explicit parameter field if the payload contains base-catalog.csv.
    fileToUpload The actual file attachment source, passed either as an individual uncompressed CSV format or as an entire zipped target package containing multiple structured entities
  3. Include your authorization JWT in the request header.
  4. Set the request body to form-data and add the following parameter.
    • Key: fileToUpload
    • Value: The data.ZIP to be uploaded.
      Attention: The recommended order is: Catalog, attribute, attribute description, attribute value, category, category description, category digital assets, product, product description, product attribute, product relation, product association, and product digital assets.
  5. Select the ZIP file and submit the request.
    Note: You can upload CSV files individually instead of a ZIP file.
  6. To check the status, send a GET request:
    GET https://hostname:port/catalog/api/admin/v1/data-jobs?id=<>
  7. Confirm that the process status is Completed and all import steps show Done (For example, Catalog: Done, Attribute: Done, Category: Done, and Product: Done).
    Remember: If the status is Failed, review the error details, resolve the issue, and run the request again.
  8. Verify the status of the imported sample data using the GET APIs:
    GET https://hostname:port/catalog/api/admin/v1/data-jobs/import/{jobId}
    • 
      "executionTime": "48 seconds",
      "executionTimeMs": 48813,
      "fileName": "Emerald.zip",
      "jobId": "nmjzcog0q123ogwdiagw3",
      "message": "Job processed with 0 failed records.",
      "status": "COMPLETED",
      "steps": [
      {
      "executionTime": "0.1 seconds",
      "executionTimeMs": 60,
      "readCount": 1,
      "skippedCount": 0,
      "status": "COMPLETED",
      "stepName": "catalogCsvImportStep",
      "writtenCount": 1
      },
      {
      "executionTime": "0.1 seconds",
      "executionTimeMs": 143,
      "readCount": 184,
      "skippedCount": 0,
      "status": "COMPLETED",
      "stepName": "attributeCsvImportStep",
      "writtenCount": 184
      }]}

Updating the data

Procedure

After loading the sample data, update the required CSV files and rerun the import to apply the changes.