Skip to main content
This section covers all webhook events related to categories, including category creation, updates, deletions, and relationship changes.

Event Types

The following category-related events are available:
  • category.create - Triggered when a new category is created
  • category.update - Triggered when an existing category is modified
  • category.deleted - Triggered when a category is deleted
  • category_relationship.created - Triggered when a product is assigned to a category
  • category_relationship.deleted - Triggered when a product is removed from a category

Category Created/Updated Event

The category.create and category.update events share the same payload structure.

Event Structure

{
  "event_type": "category.create", // or category.update
  "payload": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "name": "Winter Collection",
    "slug": "winter-collection",
    "full_uri": "clothing/collections/winter-collection",
    "parent_id": "123e4567-e89b-12d3-a456-426614174001",
    "status": "active",
    "translations": {
      "name": [
        {
          "country_code": "us",
          "value": "Winter Collection"
        },
        {
          "country_code": "es",
          "value": "Colección de Invierno"
        }
      ],
      "slug": [
        {
          "country_code": "us",
          "value": "winter-collection"
        },
        {
          "country_code": "es",
          "value": "coleccion-de-invierno"
        }
      ]
    },
    "attributes": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174002",
        "name": "Season",
        "description": "Season attribute",
        "key": "season",
        "template_key": "season_template",
        "values": {
          "season": [
            {
              "id": "123e4567-e89b-12d3-a456-426614174003",
              "key": "winter",
              "type": "season",
              "value": "Winter",
              "translations": {
                "value": [
                  {
                    "country_code": "us",
                    "value": "Winter"
                  },
                  {
                    "country_code": "es",
                    "value": "Invierno"
                  }
                ]
              }
            }
          ]
        },
        "translations": {
          "name": [
            {
              "country_code": "us",
              "value": "Season"
            },
            {
              "country_code": "es",
              "value": "Temporada"
            }
          ],
          "description": [
            {
              "country_code": "us",
              "value": "Season attribute"
            },
            {
              "country_code": "es",
              "value": "Atributo de temporada"
            }
          ]
        },
        "filterable": true,
        "translatable": true,
        "created_at": "2024-02-12T12:00:00Z",
        "updated_at": "2024-02-12T12:00:00Z"
      }
    ],
    "created_at": "2024-02-12T12:00:00Z",
    "updated_at": "2024-02-12T12:00:00Z"
  }
}

Field Descriptions

FieldTypeDescription
idstringUnique identifier for the category
namestringDisplay name of the category
slugstringURL-friendly identifier
full_uristringFull path including parent categories
parent_idstringID of the parent category (if any)
statusstringCategory status (active, inactive, draft)
translationsobjectLocalized content for the category
attributesarrayAssociated attributes for the category
created_atstringCreation timestamp
updated_atstringLast update timestamp

Category Deleted Event

The category.deleted event is triggered when a category is removed from the system.

Event Structure

{
  "event_type": "category.deleted",
  "payload": {
    "id": "123e4567-e89b-12d3-a456-426614174000"
  }
}

Field Descriptions

FieldTypeDescription
idstringUnique identifier of the deleted category

Category Relationship Created Event

The category_relationship.created event is triggered when a product is assigned to a category.

Event Structure

{
  "event_type": "category_relationship.created",
  "payload": {
    "product_id": "123e4567-e89b-12d3-a456-426614174000",
    "category": {
      "id": "123e4567-e89b-12d3-a456-426614174001",
      "name": "Winter Collection",
      "slug": "winter-collection",
      "full_uri": "clothing/collections/winter-collection",
      "parent_id": "123e4567-e89b-12d3-a456-426614174002",
      "status": "active",
      "translations": {
        "name": [
          {
            "country_code": "us",
            "value": "Winter Collection"
          }
        ],
        "slug": [
          {
            "country_code": "us",
            "value": "winter-collection"
          }
        ]
      },
      "attributes": [],
      "created_at": "2024-02-12T12:00:00Z",
      "updated_at": "2024-02-12T12:00:00Z"
    }
  }
}

Field Descriptions

FieldTypeDescription
product_idstringID of the product being assigned
categoryobjectFull category object the product is assigned to

Category Relationship Deleted Event

The category_relationship.deleted event is triggered when a product is removed from a category.

Event Structure

{
  "event_type": "category_relationship.deleted",
  "payload": {
    "product_id": "123e4567-e89b-12d3-a456-426614174000",
    "category_id": "123e4567-e89b-12d3-a456-426614174001"
  }
}

Field Descriptions

FieldTypeDescription
product_idstringID of the product being removed
category_idstringID of the category the product is removed from