Create a custom attribute in the product catalog

The product catalog contains a set of predefined product attributes. The Product Id attribute is required, the rest are optional.

There are predefined attributes that were configured at the provisioning stage and custom attributes. Predefined attributes cannot be edited. productId is one of them. It's the key field in any product catalog dataset that uniquely identifies the records.

Each of the predefined attributes contains an internal name that you need for queries and mutations and a user-friendly display name visible in the GUI.

Internal nameDisplay nameData format
availabilityAvailabilityText
brandBrand NameText
brandDescriptionBrand DescriptionText
categoryCategoryText
currencyCurrencyText
dateAddedDate AddedDate. The following formats are supported:

- YYYY-MM-DD
- MM/DD/YYYY
- DD/MM/YYYY
- YYYY/MM/DD
- DD.MM.YYYY
- YYYY-MM-DDTHH:mm:ssZ
descriptionProduct DescriptionText
dimensionsDimensionsArray
discountDiscountNumber
nameProduct NameText
modelModelText
msrpMSRPNumber
pricePriceNumber
productIdProduct IdText
productUrlsProduct URLsArray
quantityQuantityNumber
ratingProduct RatingNumber
statusProduct StatusText
skuSKUText

To add an additional product attribute to the product catalog, use the updateDataSet mutation. The total number of product attributes within the product catalog cannot exceed 2000.

mutation {
  updateDataSet(
    to: {
      attributes: {
        create: [
          { name: "Available Offline", type: BOOLEAN }
          { name: "Region", type: TEXT }
          { name: "Product page", type: TEXT, validateAs: URL }
          { name: "Stores", type: ARRAY, validateAs: TEXT}
        ]
      }
    }
    where: { dataSetId: "1e51480c-074a-5fd7-0101-xxxxxxxxxxx" }
  ) {
    dataSetId
  }
}
{
  "data": {
    "updateDataSet": {
      "dataSetId": "1e51480c-074a-5fd7-0101-xxxxxxxxxxx"
    }
  }
}

Arguments

Arguments required by the updateDataSet object

ArgumentNested fieldValuesDefinition
wheredataSetIdIDThe ID of your product catalog
toattributesObjectThe changes you want to make

You must nest the create array into attributes and add an object for each new product attribute. Here are the fields supported by objects in the attributes.create array.

FieldValuesRequired?Definition
nameString. Case-sensitive and unique within product catalog.RequiredThe name of the new product attribute. It will be used both as an internal name and display name.
typeString. Valid values:

- TEXT
- NUMBER
- BOOLEAN
- DATE
- JSON
- ARRAY
RequiredThe data format of the attribute
validateAsEnumeration.

Valid values for text attributes:

- TEXT

- URL.Valid values for array attributes:

- BOOLEAN

- DATE

- NUMBER

- TEXT

- URL.
OptionalUse this field to provide additional details about the data format. This will improve validation during product import (only properly formatted data according to this type will be accepted).

validateAs applies only to the product attributes of the TEXT and ARRAY types. For example, you can specify that a text attribute contains URLs or that an array is an array of numeric values.

Fields

Fields returned the updateDataSet mutation

FieldValuesRequired?Definition
dataSetIdIDRequiredThe ID of your product catalog