Skip to main content

Custom Attributes

Custom attributes in Product Experience Manager (PXM) offer a powerful way to store additional metadata for hierarchies, nodes, and prices. These attributes, structured as key-value pairs, enhance flexibility by enabling businesses to tailor data for both internal operations and customer-facing catalogs.

To ensure clear data management and visibility control, custom attributes are divided into two types: admin_attributes and shopper_attributes. Each serves a distinct purpose, providing businesses with the ability to separate internal data from information intended for shoppers. Understanding the differences between these types of attributes is key to leveraging their full potential.

Overview of Shopper and Admin Attributes

Here’s what you need to know about shopper and admin attributes:

Shopper Attributes

Shopper attributes are designed for data that is visible in catalogs and accessible to both shoppers and administrators. These attributes allow businesses to present meaningful, customer-facing information that enhances the shopping experience. Common use cases include:

  • Promotional Tags: Label products with promotions, such as "promotion": "Black Friday".
  • Product Metadata: Include filterable attributes like "color": "red" or "material": "cotton" to improve search and filtering functionality.
  • Category Labels: Add context-specific tags, such as "category_label": "Electronics", to improve product categorization.

Shopper attributes are included in catalogs and can be used dynamically by storefronts to improve personalization and discoverability.

Admin Attributes

Admin attributes are private and intended exclusively for internal use. They are not visible in catalogs or accessible to shoppers, making them ideal for operational data. Common use cases include:

  • Cost Tracking: Track internal costs with attributes like "production_cost": "50.00".
  • Workflow Management: Monitor internal workflows, such as "approval_status": "pending".
  • System Integrations: Store keys for integrations with enterprise systems like ERPs, such as "supplier_code": "A123".

These characteristics make shopper and admin attributes essential tools for tailoring catalogs, streamlining internal operations, and managing data visibility effectively.

Limits of Custom Attributes

Custom attributes in Product Experience Manager (PXM) have the following limits:

  • Each group, shopper_attributes or admin_attributes, can contain up to 100 custom attributes.
  • Values must be stored as strings.

Using Custom Attributes

Custom attributes can be created, updated or deleted using a single request payload. The API performs a partial update, meaning only the attributes explicitly included in the request will be modified or deleted. Any attributes not mentioned in the request will remain unchanged.

  • Creating/Updating Custom Attributes:
    Include the attributes you want to create/update in the request payload. You can add new attributes or update the values of existing ones.

  • Deleting Custom Attributes:
    Set its value to null in the request payload. This removes the attribute from the entity.

Example:

{
"data": {
"type": "hierarchy",
"id": "hierarchy-id",
"attributes": {
"shopper_attributes": {
"promotion": "Holiday Sale",
"category_label": "Gadgets",
"seasonal_discount": null
},
"admin_attributes": {
"approval_status": "approved",
"workflow_stage": null
}
}
}
}

What Happens:

  • In shopper_attributes:
    • promotion is added or updated to "Holiday Sale".
    • category_label is added or updated to "Gadgets".
    • seasonal_discount is deleted because its value is set to null.
  • In admin_attributes:
    • approval_status is added or updated to "approved".
    • workflow_stage is deleted because its value is set to null.
  • Any other attributes not included in the payload remain unchanged.

Supported Endpoints

Manage custom attributes across hierarchies, nodes, and pricebook prices with these endpoints: