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.
Field | Values | Required? | Description |
---|---|---|---|
attributes | Array | Required | An 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
Field | Values | Definition |
---|---|---|
name | String | The 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. |
value | Depends on the type of attribute | The value set to the product attribute |
Fields
The createProduct
mutation returns the following fields.
Field | Values | Required | Description |
---|---|---|---|
attributes | Object | Required | The product attributes populated for the product |
metadata | Object | Optional | See nested fields. |
Fields supported by the attributes
object
Field | Values | Required? | Definition |
---|---|---|---|
name | String | Required | The name of a product attribute |
value | Depends on the type of attribute | Optional | The value set to the product attribute |
type | One of the following values: - TEXT - NUMBER - BOOLEAN - DATE - JSON - ARRAY | Optional | The data format of the product attribute |
Fields supported by the metadata
object
Field | Nested field | Values | Description |
---|---|---|---|
dataSetId | String | The ID of your product catalog | |
tracking | createdBy | String | The login ID of the user who added the product to Connect |
createdAt | A date-time string at UTC, such as 2025-02-03T09:54:33Z | Shows when the product was added to Connect. | |
lastModifiedBy | String | The login name of the user who last modified the product | |
lastModifiedAt | A date-time string at UTC, such as 2025-02-03T09:54:33Z | Shows when the product was modified last time. |