@wix/ditto-codegen-public 1.0.162 → 1.0.163

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/dist/docs-output/api-docs/bookings-bookings-onBookingCanceled-doc.txt +169 -0
  2. package/dist/docs-output/api-docs/bookings-bookings-onBookingCreated-doc.txt +154 -0
  3. package/dist/docs-output/api-docs/crm-contacts-onContactCreated-doc.txt +87 -171
  4. package/dist/docs-output/api-docs/crm-contacts-onContactDeleted-doc.txt +58 -0
  5. package/dist/docs-output/api-docs/crm-contacts-onContactUpdated-doc.txt +99 -0
  6. package/dist/docs-output/api-docs/data-items-get-doc.txt +95 -54
  7. package/dist/docs-output/api-docs/data-items-insert-doc.txt +235 -43
  8. package/dist/docs-output/api-docs/data-items-onDataItemCreated-doc.txt +61 -0
  9. package/dist/docs-output/api-docs/data-items-onDataItemDeleted-doc.txt +58 -0
  10. package/dist/docs-output/api-docs/data-items-onDataItemUpdated-doc.txt +61 -0
  11. package/dist/docs-output/api-docs/data-items-query-doc.txt +507 -302
  12. package/dist/docs-output/api-docs/data-items-remove-doc.txt +120 -40
  13. package/dist/docs-output/api-docs/data-items-update-doc.txt +425 -46
  14. package/dist/docs-output/api-docs/ecom-cart-addToCart-doc.txt +488 -0
  15. package/dist/docs-output/api-docs/ecom-cart-createCart-doc.txt +518 -0
  16. package/dist/docs-output/api-docs/ecom-cart-createCheckout-doc.txt +155 -0
  17. package/dist/docs-output/api-docs/ecom-cart-deleteCart-doc.txt +92 -0
  18. package/dist/docs-output/api-docs/ecom-cart-getCart-doc.txt +376 -0
  19. package/dist/docs-output/api-docs/ecom-cart-onCartCreated-doc.txt +89 -80
  20. package/dist/docs-output/api-docs/ecom-cart-onCartUpdated-doc.txt +91 -81
  21. package/dist/docs-output/api-docs/ecom-cart-removeLineItemsFromCart-doc.txt +321 -0
  22. package/dist/docs-output/api-docs/ecom-cart-updateCart-doc.txt +539 -0
  23. package/dist/docs-output/api-docs/ecom-checkout-addToCheckout-doc.txt +1005 -0
  24. package/dist/docs-output/api-docs/ecom-checkout-createCheckout-doc.txt +1641 -0
  25. package/dist/docs-output/api-docs/ecom-checkout-getCheckout-doc.txt +1027 -0
  26. package/dist/docs-output/api-docs/ecom-checkout-onCheckoutCompleted-doc.txt +151 -0
  27. package/dist/docs-output/api-docs/ecom-checkout-onCheckoutCreated-doc.txt +150 -0
  28. package/dist/docs-output/api-docs/ecom-checkout-onCheckoutUpdated-doc.txt +150 -0
  29. package/dist/docs-output/api-docs/ecom-checkout-removeLineItemsFromCheckout-doc.txt +879 -0
  30. package/dist/docs-output/api-docs/ecom-checkout-updateCheckout-doc.txt +1011 -0
  31. package/dist/docs-output/api-docs/ecom-currentCart-getCurrentCart-doc.txt +368 -322
  32. package/dist/docs-output/api-docs/ecom-currentCart-updateCurrentCart-doc.txt +506 -321
  33. package/dist/docs-output/api-docs/ecom-orders-bulkUpdateOrders-doc.txt +1040 -0
  34. package/dist/docs-output/api-docs/ecom-orders-cancelOrder-doc.txt +608 -0
  35. package/dist/docs-output/api-docs/ecom-orders-getOrder-doc.txt +926 -0
  36. package/dist/docs-output/api-docs/ecom-orders-onOrderCreated-doc.txt +245 -0
  37. package/dist/docs-output/api-docs/ecom-orders-onOrderUpdated-doc.txt +244 -0
  38. package/dist/docs-output/api-docs/ecom-orders-searchOrders-doc.txt +670 -0
  39. package/dist/docs-output/api-docs/ecom-orders-updateOrder-doc.txt +818 -0
  40. package/dist/docs-output/api-docs/search-wixSiteSearch-search-doc.txt +162 -0
  41. package/dist/docs-output/api-docs/stores-collections-addProductsToCollection-doc.txt +86 -0
  42. package/dist/docs-output/api-docs/stores-collections-createCollection-doc.txt +108 -0
  43. package/dist/docs-output/api-docs/stores-collections-getCollection-doc.txt +102 -0
  44. package/dist/docs-output/api-docs/stores-collections-queryCollections-doc.txt +209 -0
  45. package/dist/docs-output/api-docs/stores-collections-removeProductsFromCollection-doc.txt +86 -0
  46. package/dist/docs-output/api-docs/stores-collections-updateCollection-doc.txt +110 -0
  47. package/dist/docs-output/api-docs/stores-inventory-queryInventory-doc.txt +98 -0
  48. package/dist/docs-output/api-docs/stores-inventory-updateInventoryVariants-doc.txt +249 -0
  49. package/dist/docs-output/api-docs/stores-inventoryItemsV3-queryInventoryItems-doc.txt +236 -0
  50. package/dist/docs-output/api-docs/stores-inventoryItemsV3-updateInventoryItem-doc.txt +139 -0
  51. package/dist/docs-output/api-docs/stores-productsV3-createProduct-doc.txt +1697 -0
  52. package/dist/docs-output/api-docs/stores-productsV3-deleteProduct-doc.txt +73 -0
  53. package/dist/docs-output/api-docs/stores-productsV3-getProduct-doc.txt +933 -0
  54. package/dist/docs-output/api-docs/stores-productsV3-onProductCreated-doc.txt +794 -0
  55. package/dist/docs-output/api-docs/stores-productsV3-onProductDeleted-doc.txt +794 -0
  56. package/dist/docs-output/api-docs/stores-productsV3-onProductUpdated-doc.txt +794 -0
  57. package/dist/docs-output/api-docs/stores-productsV3-queryProducts-doc.txt +1051 -0
  58. package/dist/docs-output/api-docs/stores-productsV3-searchProducts-doc.txt +1144 -0
  59. package/dist/docs-output/api-docs/stores-productsV3-updateProduct-doc.txt +1730 -1600
  60. package/dist/docs-output/api-docs/stores-readOnlyVariantsV3-queryVariants-doc.txt +290 -0
  61. package/dist/docs-output/api-docs/stores-readOnlyVariantsV3-searchVariants-doc.txt +353 -0
  62. package/dist/out.js +929 -79
  63. package/package.json +2 -2
  64. package/dist/docs-output/api-docs/data-items-onDataItemCreated.txt +0 -103
  65. package/dist/docs-output/api-docs/stores-product-onProductCreated-doc.txt +0 -118
  66. package/dist/docs-output/api-docs/stores-productV3-onProductCreated-doc.txt +0 -184
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.162",
3
+ "version": "1.0.163",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -24,5 +24,5 @@
24
24
  "@wix/ditto-codegen": "1.0.0",
25
25
  "esbuild": "^0.25.9"
26
26
  },
27
- "falconPackageHash": "9fc5049b2a527b2bac7e0bad772c1de1a75f9b1bfbe0d687169ce8fe"
27
+ "falconPackageHash": "8c620e7ce5339a5513154b10ae3f96ffccdd916e1ea413b15bf5763b"
28
28
  }
@@ -1,103 +0,0 @@
1
- <data_items_onDataItemCreated>
2
- <purpose>Registers a callback function as an event handler. Triggered when a data item is inserted. This method registers a callback function as an event handler. When developing websites or building apps with Blocks, use a Velo backend event instead of this method. The way you call this method differs depending on the framework you are working in: When using the CLI, run the generate command to add an event extension, and then call this method within the extension code. When building a self-hosted app, subscribe your app to the relevant event, and then call this method on your server.</purpose>
3
- <use_cases>
4
- - Log or audit new records inserted into collections
5
- - Sync newly created items to external systems or data warehouses
6
- - Trigger automations/workflows when specific collections receive new items
7
- - Enrich or validate inserted items asynchronously
8
- - Notify admins or stakeholders when critical items are added
9
- </use_cases>
10
-
11
- <method_declaration>
12
- data.items.onDataItemCreated(handler)
13
- </method_declaration>
14
- <required_parameters>
15
- - handler: function - handler(event: DataItemCreatedEnvelope): void | Promise<void>
16
- </required_parameters>
17
- <optional_parameters>
18
- None
19
- </optional_parameters>
20
- <import>import { data } from '@wix/data'</import>
21
- <types>
22
-
23
- **DataItemCreatedEnvelope**
24
- Properties:
25
- - event: DataItemCreatedEnvelope - The data item creation event envelope
26
-
27
- **DataItemCreatedEvent**
28
- Properties:
29
- - entity: DataItemEntity - The created item event data
30
- - metadata: EventMetadata - Event metadata
31
-
32
- **DataItemEntity**
33
- Properties:
34
- - _id: string - Data item ID
35
- - data: WixDataItem - Data item contents
36
- - dataCollectionId: string - ID of the collection to which this item belongs.
37
-
38
- **WixDataItem**
39
- Properties:
40
- - createdDate: Date - Date and time the item was added to the collection.
41
- - _id: string - Data item ID
42
- - _owner: string - ID of the user who created the item. Can be modified with site owner permissions.
43
- - _updatedDate: Date - Date and time the item was last modified. When the item is first inserted, _createdDate and _updatedDate have the same value.
44
-
45
- **EventMetadata**
46
- Properties:
47
- - _id: string - Unique event ID. Allows clients to ignore duplicate webhooks.
48
- - entityEventSequence: string - A sequence number defining the order of updates to the underlying entity.
49
- - entityFqdn: string - Assumes actions are also always typed to an entity_type Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
50
- - entityId: string - ID of the entity associated with the event.
51
- - eventTime: Date - Event timestamp in ISO-8601 format and UTC time.
52
- - eventType: string - Event type
53
- - identity: IdentificationData - The identification type and identity data.
54
- - instanceId: string - App instance ID.
55
- - originatedFrom: string - If present, indicates the action that triggered the event.
56
- - slug: string - This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) This is although the created/updated/deleted notion is duplication of the oneof types
57
- - triggeredByAnonymizeRequest: boolean - Whether the event was triggered as a result of a privacy regulation application (for example, GDPR).
58
-
59
- </types>
60
- <important_notes>
61
- - This method registers a callback function as an event handler
62
- - When developing websites or building apps with Blocks, use a Velo backend event instead of this method
63
- - The way you call this method differs depending on the framework you are working in:
64
- - When using the CLI, run the generate command to add an event extension, and then call this method within the extension code
65
- - When building a self-hosted app, subscribe your app to the relevant event, and then call this method on your server
66
- - The handler function can be either synchronous (void) or asynchronous (Promise<void>)
67
- - Triggered when a data item is inserted
68
- - Required Permission: 'SCOPE.DC-DATA.READ'
69
- </important_notes>
70
-
71
- <event_triggers>
72
- - Data Item Created: This event is triggered automatically when a new item is inserted into a collection
73
- </event_triggers>
74
- <example_usage>
75
- ```typescript
76
- import { items } from '@wix/data';
77
-
78
- // Register event handler for data item creation
79
- export default items.onDataItemCreated((event) => {
80
- const created = event.entity;
81
- console.log('Item created in collection:', created.dataCollectionId);
82
- console.log('New item ID:', created._id);
83
- // Access the inserted item payload
84
- console.log('Item payload:', created.data);
85
- });
86
-
87
- // Async handler example
88
- export default items.onDataItemCreated(async (event) => {
89
- const created = event.entity;
90
- const createdItem = await items.get(created.dataCollectionId, created._id);
91
- console.log('Created item:', createdItem);
92
- });
93
- ```
94
- </example_usage>
95
- <related_methods>
96
- - data.items.onDataItemUpdated() - Event handler for item updates
97
- - data.items.onDataItemDeleted() - Event handler for item deletions
98
- - data.items.insert() - Insert a new item into a collection
99
- - data.items.get() - Retrieve an item by ID
100
- - data.items.query() - Query items in a collection
101
- </related_methods>
102
- </data_items_onDataItemCreated>
103
-
@@ -1,118 +0,0 @@
1
- <stores_product_onProductCreated>
2
- <purpose>Registers a callback function as an event handler. Triggered when a product is created. This method registers a callback function as an event handler. When developing websites or building apps with Blocks, use a Velo backend event instead of this method. The way you call this method differs depending on the framework you are working in: When using the CLI, run the generate command to add an event extension, and then call this method within the extension code. When building a self-hosted app, subscribe your app to the relevant event, and then call this method on your server.</purpose>
3
- <use_cases>
4
- - Send notifications when new products are added to the catalog
5
- - Synchronize product data with external systems or databases
6
- - Trigger automated workflows for new product onboarding
7
- - Log product creation events for analytics and monitoring
8
- - Send welcome emails or notifications to relevant stakeholders
9
- - Update inventory systems or third-party services
10
- - Perform data validation or enrichment on new products
11
- - Trigger marketing campaigns for new product launches
12
- </use_cases>
13
-
14
- <method_declaration>
15
- products.onProductCreated(handler)
16
- </method_declaration>
17
- <required_parameters>
18
- - handler: function - handler(event: ProductCreatedEnvelope): void | Promise<void>
19
- </required_parameters>
20
- <optional_parameters>
21
- None
22
- </optional_parameters>
23
- <import>import { products } from '@wix/stores'</import>
24
- <types>
25
-
26
- **ProductCreatedEnvelope**
27
- Properties:
28
- - event: ProductCreatedEnvelope - The product creation event data
29
-
30
- **ProductCreatedEvent**
31
- Properties:
32
- - data: ProductCreated - The created product data
33
- - metadata: BaseEventMetadata - Additional event metadata
34
-
35
- **ProductData**
36
- Properties:
37
- - productId: string - Unique product identifier
38
- - name: string - Product name
39
- - price: Price - Product pricing information
40
- - visible: boolean - Whether the product is visible to customers.
41
- - media: Media - Media items (images, videos, etc.) associated with this product.
42
- - sku: string - Product stock keeping unit (SKU). If variants are being managed, this will be empty.
43
- - productPageUrl: ProductPageUrl - Product page URL for this product (generated automatically by the server).
44
- - brand: string - Product brand.
45
- - costAndProfitData: CostAndProfitData - cost and profit data.
46
- - originatedFromVersion: string - Information about the version of the catalog from where this event was triggered.
47
- - slug: string - Event slug. A human readable identifier of the event.
48
-
49
- **Price**
50
- Properties:
51
- - price: number - Product price
52
- - currency: string - Product price currency
53
- - formatted: Formatted - Formatted price display
54
- - discountedPrice: number - Discounted product price (if no discounted price is set, the product price is returned)
55
- - pricePerUnit: number - Price per unit
56
-
57
- **Formatted**
58
- Properties:
59
- - price: string - Product price formatted with the currency
60
- - discountedPrice: string - Discounted product price formatted with the currency (if no discounted price is set, the product formatted price is returned)
61
- - pricePerUnit: string - Price per unit
62
-
63
- **Media**
64
- Properties:
65
- - mainMedia: MainMedia - Primary media (image, video etc) associated with this product.
66
- - items: MediaItem[]
67
-
68
- **BaseEventMetadata**
69
- Properties:
70
- - eventType: string - The type of event that occurred
71
- - instanceId: string - App instance ID.
72
- - identity: IdentificationData - The identification type and identity data.
73
- </types>
74
- <important_notes>
75
- - This method registers a callback function as an event handler
76
- - When developing websites or building apps with Blocks, use a Velo backend event instead of this method
77
- - The way you call this method differs depending on the framework you are working in:
78
- - When using the CLI, run the generate command to add an event extension, and then call this method within the extension code
79
- - When building a self-hosted app, subscribe your app to the relevant event, and then call this method on your server
80
- - The handler function can be either synchronous (void) or asynchronous (Promise<void>)
81
- - Triggered when a product is created
82
- - **Required Permission**: In order to use this method, the app must have the permission scope named "SCOPE.DC-STORES.READ-PRODUCTS"
83
- </important_notes>
84
-
85
- <event_triggers>
86
- - Product Created: This event is triggered automatically when a new product is successfully created in the Wix Stores catalog
87
- </event_triggers>
88
- <example_usage>
89
- ```typescript
90
- import { products } from '@wix/stores';
91
-
92
- // Register event handler for product creation
93
- export default products.onProductCreated((event) => {
94
- console.log('New product created:', event.data.name);
95
- console.log('Product ID:', event.data.productId);
96
- });
97
-
98
- // Async event handler example
99
- export default products.onProductCreated(async (event) => {
100
- try {
101
- console.log('Processing product creation event');
102
- // Perform async operations
103
- await processNewProduct(event.data);
104
- } catch (error) {
105
- console.error('Error processing product creation:', error);
106
- }
107
- });
108
- ```
109
- </example_usage>
110
- <related_methods>
111
- - products.onProductChanged() - Event handler for product modifications
112
- - products.onProductDeleted() - Event handler for product deletions
113
- - products.createProduct() - Method to create new products
114
- - products.getProduct() - Method to retrieve product details
115
- - products.updateProduct() - Method to update existing products
116
- - products.queryProducts() - Method to query products with filters
117
- </related_methods>
118
- </stores_product_onProductCreated>
@@ -1,184 +0,0 @@
1
- <stores_productsV3_onProductCreated>
2
- <purpose>
3
- Registers an event handler that is triggered when a new product is created in your Wix Stores catalog.
4
- This function allows you to perform custom logic such as synchronizing data, sending notifications, or triggering workflows when a new product is added.
5
- </purpose>
6
-
7
- <use_cases>
8
- - Send notifications when new products are added to the catalog
9
- - Synchronize product data with external systems or databases
10
- - Trigger automated workflows for product onboarding
11
- - Log product creation events for analytics or monitoring
12
- - Update inventory or pricing in external systems
13
- - Trigger marketing campaigns or product announcements
14
- - Perform data validation or enrichment upon product creation
15
- </use_cases>
16
-
17
- <method_declaration>
18
- productsV3.onProductCreated(handler)
19
- </method_declaration>
20
-
21
- <required_parameters>
22
- - handler: function — A callback function to handle the event.
23
- Signature: (event: ProductCreatedEnvelope) => void | Promise<void>
24
- </required_parameters>
25
-
26
- <optional_parameters>
27
- None
28
- </optional_parameters>
29
-
30
- <import>
31
- import { productsV3 } from '@wix/stores';
32
- </import>
33
-
34
- <types>
35
-
36
- **ProductCreatedEnvelope**
37
- Properties:
38
- - entity: V3Product — The created product data
39
- - metadata: EventMetadata — Event metadata information
40
-
41
- **V3Product**
42
- Properties:
43
- - _createdDate: Date — Date and time the product was created.
44
- - _id: string — Unique product identifier
45
- - actualPriceRange: PriceRange - Product actualPrice range - minimum and maximum prices of all product variants.
46
- - allCategoriesInfo: ProductCategoriesInfo - List of categories that directly contain this product, as well as their parent categories.
47
- - breadcrumbsInfo: BreadcrumbsInfo - Breadcrumbs of the mainCategoryId. Used to navigate to parent categories.
48
- - compareAtPriceRange: PriceRange - Product compareAtPrice range - minimum and maximum compare at prices of all product variants.
49
- - costRange: PriceRange - Product cost range - minimum and maximum costs of all product variants.
50
- - currency: string - Currency used for the pricing of this product, in ISO-4217 format. Defaults to the currency defined in the site settings, unless specified in x-wix-currency header.
51
- - description: RichContent - Product description using rich content.
52
- - directCategoriesInfo: ProductCategoriesInfo - List of categories that directly contain this product.
53
- - extendedFields: ExtendedFields - Custom extended fields for the product object.
54
- - handle: string - A unique human-friendly identifier for the product. Unlike the product ID, the handle can be set by the user to ensure consistency across multiple platforms. In case handle wasn't given, the handle will be automatically generated.
55
- - infoSections: InfoSection[] — Additional information sections
56
- - inventroy: Inventory - Product inventory info.
57
- - mainCategoryId: string - The ID of the product's primary direct category, which defines the product’s breadcrumbs path. For example, if the product's main category is "T-Shirts" (which is a subcategory of "Clothing"), the breadcrumbs path will be "Clothing > T-Shirts".
58
- - media: Media - Product media items.
59
- - modifiers: ConnectedModifier[] - Product modifiers.
60
- - name: string - Product name. Translatable.
61
- - options: ConnectedOption[] - Product options. Allows the customer to customize the product. For example, selecting color, size, and more.
62
- - plainDescription: string - Product description in HTML.
63
- - productType: ProductType - Product type.
64
- - revision: string - Revision number, which increments by 1 each time the product is updated. To prevent conflicting changes, the current revision must be passed when updating the product.
65
- - ribbon: Ribbon - Product ribbon.
66
- - seoData: SeoSchema - Product SEO data.
67
- - slug: string - Product slug
68
- - subscriptionDetails: SubscriptionDetails - Product subscriptions.
69
- - taxGroupId: string - Tax group ID
70
- - url: string - URL to the site's product page.
71
- - variantSummary: VariantSummary - The total number of variants for the product.
72
- - variantsInfo: VariantsInfo - Product variants. Each variant must reference all product options via its choices array. Each choice references an option using optionChoiceNames for all requests.
73
- - visible: boolean - Whether the product is visible to site visitors on the site. Default: true
74
- - visibleInPos: boolean - Whether the product is visible in POS (point of sale). Default: true
75
- - physicalProperties: PhysicalProperties - Physical properties. Required when productType: PHYSICAL.
76
-
77
- **PriceRange**
78
- Properties:
79
- - maxValue: FixedMonetaryAmount - Maximum value
80
- - minValue: FixedMonetaryAmount - Minimum value
81
-
82
- **FixedMonetaryAmount**
83
- Properties:
84
- - amount: string - Monetary amount. For example, "3.99", or "-4.99" for a negative amount.
85
- - formattedAmount: string - Formatted monetary amount. For example, "$3.99".
86
- - brand: Brand — Product brand information
87
-
88
- **ProductCategoriesInfo**
89
- Properties:
90
- - categories: ProductCategory[] - A list of categories related to product.
91
-
92
- **ProductCategory**
93
- Properties:
94
- - _id: string - Category ID
95
- - index: number - Index location of the product within the category, which can be utilized for sorting products in a specific category.
96
-
97
- **Brand**
98
- Properties:
99
- - _id: string - Brand ID
100
- - name: string - Brand name
101
-
102
- **Inventory**
103
- Properties:
104
- - availabilityStatus: InventoryAvailabilityStatus - Current availability status.
105
- - preorderAvailability: ProductPreorderAvailability - Preorder availability status.
106
- - preorderStatus: PreorderStatus — Current preorder status.
107
-
108
- **Ribbon**
109
- Properties:
110
- - _id: string - Ribbon ID
111
- - name: string - Ribbon name
112
-
113
- **PhysicalProperties**
114
- Properties:
115
- - deliveryProfileId: string - Delivery profile ID.
116
- - fulfillerId: string - Fulfiller ID.
117
- - pricePerUnit: PricePerUnitSettings - Price per unit settings.
118
- - pricePerUnitRange: PricePerUnitRange - Product price per unit range. The minimum and maximum price per unit of all the variants.
119
- - shippingWeightRange: WeightRange - Product shipping weight range - Calculated from the lightest and heaviest variant shipping weights.
120
- - weightMeasurementUnitInfo: WeightMeasurementUnitInfo - Weight measurement unit.
121
-
122
- **PricePerUnit**
123
- Properties:
124
- - measurementUnit: MeasurementUnit - Measurement unit. For example, to define price per 100 grams, set this field to "G".
125
- - quantity: number - Quantity. For example, to define price per per 100 grams, set this field to 100.
126
-
127
- **PricePerUnitRange**
128
- Properties:
129
- - maxValue: PricePerUnitRangePricePerUnit - Maximum price per unit across all variants.
130
- - minValue: PricePerUnitRangePricePerUnit - Minimum price per unit across all variants.
131
-
132
- **PricePerUnitRangePricePerUnit**
133
- Properties:
134
- - description: string - Price per unit info in the format of variant specific data / product setting, for example €4.00 / 1 Kg.
135
- - value: string - Calculated value of price per unit. Takes into account pricePerUnit settings of product and variants and price of variants.
136
-
137
- **WeightRange**
138
- Properties:
139
- - maxValue: number - Maximum weight across all variants associated with this product.
140
- - minValue: number - Minimum weight across all variants associated with this product.
141
-
142
- **WeightMeasurementUnitInfo**
143
- Properties:
144
- - weightMeasurementUnit: WeightUnit - Weight measurement unit.
145
- </types>
146
-
147
- <important_notes>
148
- - Triggered automatically when a new product is created in Wix Stores.
149
- - The `handler` can be synchronous (void) or asynchronous (Promise<void>).
150
- - When developing with Wix Blocks, use a Velo backend event instead of this SDK event.
151
- - Usage differs by environment:
152
- - **CLI Apps:** Run the `generate` command to add an event extension, then call this method within the generated code.
153
- - **Self-Hosted Apps:** Subscribe to the "Product Created" event on your server and call this method in your app.
154
- - **Permission Required:** `SCOPE.STORES.PRODUCT_READ` — Required scope for this event handler.
155
- </important_notes>
156
-
157
- <event_triggers>
158
- - Triggered automatically when a new product is successfully created in the Wix Stores catalog.
159
- </event_triggers>
160
-
161
- <example_usage>
162
- ```typescript
163
- import { productsV3 } from '@wix/stores';
164
-
165
- // Basic example
166
- export default productsV3.onProductCreated(async (event) => {
167
- console.log('New product created:', event.entity.name);
168
- console.log('Product ID:', event.entity._id);
169
- console.log('Visible:', event.entity.visible);
170
- console.log('Inventory:', event.entity.inventory);
171
- console.log('Brand:', event.entity.brand);
172
- console.log('Event ID:', event.metadata._id);
173
- console.log('Event Time:', event.metadata.eventTime);
174
- });
175
-
176
- // Async example
177
- export default productsV3.onProductCreated(async (event) => {
178
- try {
179
- console.log('Processing product creation for:', event.entity.name);
180
- await syncProductToExternalSystem(event.entity);
181
- } catch (err) {
182
- console.error('Error processing product creation:', err);
183
- }
184
- });