> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Package: catalogV1

# Namespace: catalog

# Webhook link: https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v1/catalog/collection-created.md

# Webhook Permissions Scopes IDs:
Read Products: SCOPE.DC-STORES.READ-PRODUCTS

## Introduction

Triggered when a collection is created.

---

## REST API

### Schema

```
Webhook: Collection Created
Description: Triggered when a collection is created.
Payload: CollectionCreated
  - name: collection_Id | type: string | description: Collection GUID (generated automatically by the catalog).
  - name: name | type: string | description: Collection name.
  - name: media | type: Media | description: Media items (images, videos, etc.) associated with this collection.
     - name: mainMedia | type: MediaItem | description: Primary media (image, video etc) associated with this product.
        - ONE-OF:
           - name: image | type: MediaItemUrlAndSize | description: Image data (URL, size).
              - name: url | type: string | description: Media item URL.
              - name: width | type: integer | description: Media item width.
              - name: height | type: integer | description: Media item height.
              - name: format | type: string | description: Media format (mp4, png, etc.).
              - name: altText | type: string | description: Alt text. This text will be shown in case the image is not available.
           - name: video | type: MediaItemVideo | description: Video data (URL, size).
              - name: files | type: array<MediaItemUrlAndSize> | description: Data (URL, size) about each resolution for which this video is available.
              - name: stillFrameMediaId | type: string | description: GUID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.
        - name: thumbnail | type: MediaItemUrlAndSize | description: Media item thumbnail details.
        - name: mediaType | type: MediaItemType | description: Media item type (image, video, etc.).
             - enum:
             -     unspecified_media_item_type: 
             -     image: Image media type.
             -     video: Video media type.
             -     audio: Audio media type.
             -     document: Document media type.
             -     zip: Zip media type.
        - name: title | type: string | description: Media item title.
        - name: id | type: string | description: Media GUID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).
     - name: items | type: array<MediaItem> | description: Media (images, videos etc) associated with this product.
  - name: slug | type: string | description: Collection slug
  - name: visible | type: boolean | description: Collection visible status
  - name: originatedFromVersion | type: Version | description: Information about the version of the catalog from where this event was triggered.
     - enum:
     -     V1_CATALOG: Version 1 of the catalog.
     -     V3_CATALOG: Version 3 of the catalog.
     -     STORES_NOT_INSTALLED: Stores app is not installed.

```

### Examples


```curl
{
  "collectionId": "1044e7e4-37d1-0705-c5b3-623baae212fd",
  "name": "My collection",
  "slug": "my-collection",
  "visible": true,
  "media": {
    "mainMedia": {
      "thumbnail": {
        "url": "https://static.wixstatic.com/media/bc001baa4397444f809fa5f147c28a9e.jpg/v1/fit/w_50,h_50,q_90/file.jpg",
        "width": 50,
        "height": 50
      },
      "mediaType": "image",
      "title": "",
      "image": {
        "url": "https://static.wixstatic.com/media/bc001baa4397444f809fa5f147c28a9e.jpg/v1/fit/w_1920,h_1280,q_90/file.jpg",
        "width": 1920,
        "height": 1280
      },
      "id": ""
    },
    "items": [
      {
        "thumbnail": {
          "url": "https://static.wixstatic.com/media/bc001baa4397444f809fa5f147c28a9e.jpg/v1/fit/w_50,h_50,q_90/file.jpg",
          "width": 50,
          "height": 50
        },
        "mediaType": "image",
        "title": "",
        "image": {
          "url": "https://static.wixstatic.com/media/bc001baa4397444f809fa5f147c28a9e.jpg/v1/fit/w_1920,h_1280,q_90/file.jpg",
          "width": 1920,
          "height": 1280
        },
        "id": ""
      }
    ]
  }
}
```

---

## JavaScript SDK

### Schema

```
Webhook: onProductCollectionCreated
Description: Triggered when a collection is created.
Payload: ProductCollectionCreatedEnvelope
  - name: data | type: CollectionCreated | description: none
     - name: collection_Id | type: string | description: Collection GUID (generated automatically by the catalog).
     - name: name | type: string | description: Collection name.
     - name: media | type: Media | description: Media items (images, videos, etc.) associated with this collection.
        - name: mainMedia | type: MediaItem | description: Primary media (image, video etc) associated with this product.
           - ONE-OF:
              - name: image | type: MediaItemUrlAndSize | description: Image data (URL, size).
                 - name: url | type: string | description: Media item URL.
                 - name: width | type: integer | description: Media item width.
                 - name: height | type: integer | description: Media item height.
                 - name: format | type: string | description: Media format (mp4, png, etc.).
                 - name: altText | type: string | description: Alt text. This text will be shown in case the image is not available.
              - name: video | type: MediaItemVideo | description: Video data (URL, size).
                 - name: files | type: array<MediaItemUrlAndSize> | description: Data (URL, size) about each resolution for which this video is available.
                 - name: stillFrameMediaId | type: string | description: GUID of an image taken from the video. Used primarily for Wix Search indexing. For example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`.
           - name: thumbnail | type: MediaItemUrlAndSize | description: Media item thumbnail details.
           - name: mediaType | type: MediaItemType | description: Media item type (image, video, etc.).
                 - enum:
                 -     unspecified_media_item_type: 
                 -     image: Image media type.
                 -     video: Video media type.
                 -     audio: Audio media type.
                 -     document: Document media type.
                 -     zip: Zip media type.
           - name: title | type: string | description: Media item title.
           - name: _id | type: string | description: Media GUID (for example, `"nsplsh_306d666a123a4a74306459~mv2_d_4517_2992_s_4_2.jpg"`).
        - name: items | type: array<MediaItem> | description: Media (images, videos etc) associated with this product.
     - name: slug | type: string | description: Collection slug
     - name: visible | type: boolean | description: Collection visible status
     - name: originatedFromVersion | type: Version | description: Information about the version of the catalog from where this event was triggered.
         - enum:
         -     V1_CATALOG: Version 1 of the catalog.
         -     V3_CATALOG: Version 3 of the catalog.
         -     STORES_NOT_INSTALLED: Stores app is not installed.
  - name: metadata | type: BaseEventMetadata | description: none
     - name: instanceId | type: string | description: App instance GUID.
     - name: eventType | type: string | description: Event type.
     - name: identity | type: IdentificationData | description: The identification type and identity data.
        - ONE-OF:
           - name: anonymousVisitorId | type: string | description: GUID of a site visitor that has not logged in to the site.
           - name: memberId | type: string | description: GUID of a site visitor that has logged in to the site.
           - name: wixUserId | type: string | description: GUID of a Wix user (site owner, contributor, etc.).
           - name: appId | type: string | description: GUID of an app.
        - name: identityType | type: WebhookIdentityType | description: 
             - enum: UNKNOWN, ANONYMOUS_VISITOR, MEMBER, WIX_USER, APP
     - name: accountInfo | type: AccountInfo | description: Details related to the account
        - name: accountId | type: string | description: GUID of the Wix account associated with the event.
        - name: parentAccountId | type: string | description: GUID of the parent Wix account. Only included when accountId belongs to a child account.
        - name: siteId | type: string | description: GUID of the Wix site associated with the event. Only included when the event is tied to a specific site.

```

### Examples


```javascript
import { products } from '@wix/stores';

products.onProductCollectionCreated((event) => {
    // handle your event here
});
```


```javascript
import { createClient, AppStrategy } from '@wix/sdk';
import { products } from '@wix/stores';

const wixClient = createClient({
  auth: AppStrategy({
    appId: 'MY-APP-ID',
    publicKey: 'YOUR_APP_PUBLIC_KEY',
  }),
  modules: {
      products,
    },
});

wixClient.products.onProductCollectionCreated((event) => {
    // handle your event here
});
```

---