Add multiple product categories to Connect

Use the createProductCategories mutation to add several product categories in a single call. The input is an array of category objects.

mutation CreateProductCategories {
  createProductCategories(
    categories: [
      {
        categoryId: "7"
        categoryName: "survival kits"
        description: "Survival kit category description"
        sourceUrl: "https://store.com/sporting_goods/camping/survival_kits"
        parent: { id: null }
        namespace: DYNAMIC
      }
    ]
  ) {
    id
    categoryId
    categoryName
    description
    namespace
    sourceUrl
    parentId
    calculatedFields { path depth }
    tracking { createdAt createdBy lastModifiedAt lastModifiedBy }
  }
}

Response

{
  "data": {
    "createProductCategories": [
      {
        "id": "873d331a-6884-40ab-b87b-cb1a962be758",
        "categoryId": "7",
        "categoryName": "survival kits",
        "description": "Survival kit category description",
        "sourceUrl": "https://store.com/sporting_goods/camping/survival_kits",
        "namespace": "CONFLICT",
        "parentId": "-1",
        "calculatedFields": {
          "path": "sporting goods > camping > survival kits",
          "depth": 2
        },
        "tracking": {
          "createdBy": "system",
          "createdAt": "2025-01-01T00:00:00.000Z",
          "lastModifiedBy": "system",
          "lastModifiedAt": "2025-01-01T00:00:00.000Z"
        }
      }
    ]
  }
}

Authentication

This API uses API Key authentication. See Using the Connect API for instructions on how to get and use your API key.