Add a product to the product catalog

To add a new product to the product catalog, use the createProduct mutation.

mutation {
  createProduct(
    productInput: {
      attributes: [
        { name: "productId", value: "UYT0002053" }
        { name: "productName", value: "Castle High Strength Cement 25 kg" }
        {
          name: "productDescription"
          value: "Made by grinding Portland cement with pozzolanic clinkers to form cement that possesses high resistance to chemical attacks. The PPC has a superior quality of fineness."
        }
        { name: "unitPrice", value: 179.99 }
        { name: "currency", value: "USD" }
        { name: "availability", value: "Out of stock" }
        { name: "brandName", value: "Concrete King" }
      ]
    }
  ) {
    attributes {
      name
      value
      type
    }
    metadata {
      dataSetId
      tracking {
        createdBy
        createdAt
        lastModifiedBy
        lastModifiedAt
      }
    }
  }
}
{
  "data": {
    "createProduct": {
      "attributes": [
        {
          "name": "productId",
          "value": "UYT0002053",
          "type": "TEXT"
        },
        {
          "name": "productName",
          "value": "Castle High Strength Cement 25 kg",
          "type": "TEXT"
        },
        {
          "name": "productDescription",
          "value": "Made by grinding Portland cement with pozzolanic clinkers to form cement that possesses high resistance to chemical attacks. The PPC has a superior quality of fineness.",
          "type": "TEXT"
        },
        {
          "name": "unitPrice",
          "value": 179.99,
          "type": "NUMBER"
        },
        {
          "name": "currency",
          "value": "USD",
          "type": "TEXT"
        },
        {
          "name": "availability",
          "value": "Out of stock",
          "type": "TEXT"
        },
        {
          "name": "brandName",
          "value": "Concrete King",
          "type": "TEXT"
        }
      ],
      "metadata": {
        "dataSetId": "bc601e80-8d87-56e4-0000-xxxxxxxxxxxx",
        "tracking": {
          "createdBy": "[email protected]",
          "createdAt": "2025-08-07T18:10:06.194Z",
          "lastModifiedBy": "[email protected]",
          "lastModifiedAt": "2025-08-07T18:10:06.194Z"
        }
      }
    }
  }
}

Arguments

The createProduct object requires the productInput argument. The argument supports the following fields.

FieldValuesRequired?Description
attributesArrayRequiredAn array of product attributes. There is a separate object for each attribute.

At least one object (Product ID) is required.

Fields supported by objects in the attributes array

FieldValuesDefinition
nameStringThe name of a product attribute.

Keep in mind that you must use internal names for the predefined product attributes. For custom attributes, the internal name coincides with the display name.

💡To fetch the names of supported attributes and their format, use the dataSets query.
valueDepends on the type of attributeThe value set to the product attribute

Fields

The createProduct mutation returns the following fields.

FieldValuesRequiredDescription
attributesObjectRequiredThe product attributes populated for the product
metadataObjectOptionalSee nested fields.

Fields supported by the attributes object

Field ValuesRequired?Definition
nameStringRequiredThe name of a product attribute
valueDepends on the type of attributeOptional The value set to the product attribute
typeOne of the following values:

- TEXT
- NUMBER
- BOOLEAN
- DATE
- JSON
- ARRAY
Optional The data format of the product attribute

Fields supported by the metadata object

FieldNested fieldValuesDescription
dataSetIdStringThe ID of your product catalog
trackingcreatedByStringThe login ID of the user who added the product to Connect
createdAtA date-time string at UTC, such as 2025-02-03T09:54:33ZShows when the product was added to Connect.
lastModifiedByStringThe login name of the user who last modified the product
lastModifiedAtA date-time string at UTC, such as 2025-02-03T09:54:33ZShows when the product was modified last time.