> 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`). > - 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/product-created.md ## Introduction Triggered when a product is created. --- ## REST API ### Schema ``` Webhook: Product Created Description: Triggered when a product is created. Payload: ProductCreated - name: productId | type: string | description: Product GUID (generated automatically by the catalog). - name: name | type: string | description: Product name. - name: price | type: PriceData | description: Product price. - name: currency | type: string | description: Product price currency - name: price | type: number | description: Product price - name: discountedPrice | type: number | description: Discounted product price (if no discounted price is set, the product price is returned) - name: formatted | type: FormattedPrice | description: The product price and discounted price, formatted with the currency - name: price | type: string | description: Product price formatted with the currency - name: discountedPrice | type: string | description: Discounted product price formatted with the currency (if no discounted price is set, the product formatted price is returned) - name: pricePerUnit | type: string | description: Price per unit - name: pricePerUnit | type: number | description: Price per unit - name: visible | type: boolean | description: Whether the product is visible to customers. - name: media | type: Media | description: Media items (images, videos, etc.) associated with this product. - 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 | 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 | description: Media (images, videos etc) associated with this product. - name: sku | type: string | description: Product stock keeping unit (SKU). If variants are being managed, this will be empty. - name: productPageUrl | type: PageUrl | description: Product page URL for this product (generated automatically by the server). - name: base | type: string | description: Base URL. For premium sites, this is the domain. For free sites, this is the site URL (e.g mysite.wixsite.com/mysite). - name: path | type: string | description: Path to the product page - e.g /product-page/a-product. - name: brand | type: string | description: Product brand. - name: costAndProfitData | type: CostAndProfitData | description: Cost and profit data - name: itemCost | type: number | description: Item cost. - name: formattedItemCost | type: string | description: Item cost formatted with currency symbol. - name: profit | type: number | description: Profit. Calculated by reducing `cost` from `discounted_price`. - name: formattedProfit | type: string | description: Profit formatted with currency symbol. - name: profitMargin | type: number | description: Profit Margin. Calculated by dividing `profit` by `discounted_price`. The result is rounded to 4 decimal places. - 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: slug | type: string | description: Event slug. A human readable identifier of the event. ``` ### Examples ```curl { "productId": "6693f74a-2a79-0bb7-00ef-2b8581bc8757", "name": "my product", "priceData": { "currency": "USD", "price": 32, "discountedPrice": 30.4, "formatted": { "price": "32.00 ₪", "discountedPrice": "30.40 ₪" } }, "visible": true, "media": { "mainMedia": { "thumbnail": { "url": "https://static.wixstatic.com/media/689fa9dd0c7f47d4b45a0b78afccdc8a.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/689fa9dd0c7f47d4b45a0b78afccdc8a.jpg/v1/fit/w_5760,h_3840,q_90/file.jpg", "width": 5760, "height": 3840 }, "id": "689fa9dd0c7f47d4b45a0b78afccdc8a.jpg" }, "items": [ { "thumbnail": { "url": "https://static.wixstatic.com/media/689fa9dd0c7f47d4b45a0b78afccdc8a.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/689fa9dd0c7f47d4b45a0b78afccdc8a.jpg/v1/fit/w_5760,h_3840,q_90/file.jpg", "width": 5760, "height": 3840 }, "id": "689fa9dd0c7f47d4b45a0b78afccdc8a.jpg" } ] }, "sku": "38473", "productPageUrl": { "base": "https://my-website.com", "path": "/product-page/my-product" } } ``` --- ## JavaScript SDK ### Schema ``` Webhook: onProductCreated Description: Triggered when a product is created. Payload: ProductCreatedEnvelope - name: data | type: ProductCreated | description: none - name: productId | type: string | description: Product GUID (generated automatically by the catalog). - name: name | type: string | description: Product name. - name: price | type: PriceData | description: Product price. - name: currency | type: string | description: Product price currency - name: price | type: number | description: Product price - name: discountedPrice | type: number | description: Discounted product price (if no discounted price is set, the product price is returned) - name: formatted | type: FormattedPrice | description: The product price and discounted price, formatted with the currency - name: price | type: string | description: Product price formatted with the currency - name: discountedPrice | type: string | description: Discounted product price formatted with the currency (if no discounted price is set, the product formatted price is returned) - name: pricePerUnit | type: string | description: Price per unit - name: pricePerUnit | type: number | description: Price per unit - name: visible | type: boolean | description: Whether the product is visible to customers. - name: media | type: Media | description: Media items (images, videos, etc.) associated with this product. - 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 | 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 | description: Media (images, videos etc) associated with this product. - name: sku | type: string | description: Product stock keeping unit (SKU). If variants are being managed, this will be empty. - name: productPageUrl | type: PageUrl | description: Product page URL for this product (generated automatically by the server). - name: base | type: string | description: Base URL. For premium sites, this is the domain. For free sites, this is the site URL (e.g mysite.wixsite.com/mysite). - name: path | type: string | description: Path to the product page - e.g /product-page/a-product. - name: brand | type: string | description: Product brand. - name: costAndProfitData | type: CostAndProfitData | description: Cost and profit data - name: itemCost | type: number | description: Item cost. - name: formattedItemCost | type: string | description: Item cost formatted with currency symbol. - name: profit | type: number | description: Profit. Calculated by reducing `cost` from `discounted_price`. - name: formattedProfit | type: string | description: Profit formatted with currency symbol. - name: profitMargin | type: number | description: Profit Margin. Calculated by dividing `profit` by `discounted_price`. The result is rounded to 4 decimal places. - 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: slug | type: string | description: Event slug. A human readable identifier of the event. - 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.onProductCreated((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.onProductCreated((event) => { // handle your event here }); ``` ---