@wix/agent-skills 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +111 -0
- package/package.json +29 -0
- package/skills/wix-app/SKILL.md +344 -0
- package/skills/wix-app/references/APP_IDENTIFIERS.md +35 -0
- package/skills/wix-app/references/APP_MARKET_REVIEW.md +311 -0
- package/skills/wix-app/references/APP_VALIDATION.md +171 -0
- package/skills/wix-app/references/BACKEND_API.md +233 -0
- package/skills/wix-app/references/BACKEND_EVENT.md +116 -0
- package/skills/wix-app/references/CODE_QUALITY.md +33 -0
- package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +587 -0
- package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +157 -0
- package/skills/wix-app/references/DASHBOARD_MODAL.md +283 -0
- package/skills/wix-app/references/DASHBOARD_PAGE.md +403 -0
- package/skills/wix-app/references/DASHBOARD_PLUGIN.md +205 -0
- package/skills/wix-app/references/DATA_COLLECTION.md +451 -0
- package/skills/wix-app/references/DOCUMENTATION.md +42 -0
- package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +65 -0
- package/skills/wix-app/references/EMBEDDED_SCRIPT.md +468 -0
- package/skills/wix-app/references/EXTENSION_REGISTRATION.md +96 -0
- package/skills/wix-app/references/SERVICE_PLUGIN.md +235 -0
- package/skills/wix-app/references/SITE_PLUGIN.md +436 -0
- package/skills/wix-app/references/STORES_VERSIONING.md +334 -0
- package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +84 -0
- package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +345 -0
- package/skills/wix-app/references/dashboard-menu-plugin/blog-slots.md +71 -0
- package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +58 -0
- package/skills/wix-app/references/dashboard-menu-plugin/crm-slots.md +8 -0
- package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +17 -0
- package/skills/wix-app/references/dashboard-menu-plugin/events-slots.md +29 -0
- package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +27 -0
- package/skills/wix-app/references/dashboard-menu-plugin/stores-slots.md +35 -0
- package/skills/wix-app/references/dashboard-page/API_SPEC.md +138 -0
- package/skills/wix-app/references/dashboard-page/DASHBOARD_API.md +573 -0
- package/skills/wix-app/references/dashboard-page/DYNAMIC_PARAMETERS.md +269 -0
- package/skills/wix-app/references/dashboard-page/ECOM_NAVIGATION.md +164 -0
- package/skills/wix-app/references/dashboard-plugin/SLOTS.md +294 -0
- package/skills/wix-app/references/data-collection/WIX_DATA.md +270 -0
- package/skills/wix-app/references/data-collection/extension-template.ts +107 -0
- package/skills/wix-app/references/editor-react-component/ACCESSIBILITY.md +138 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +454 -0
- package/skills/wix-app/references/editor-react-component/COMPONENT-CONFIGURATION.md +165 -0
- package/skills/wix-app/references/editor-react-component/CSS-GUIDELINES.md +576 -0
- package/skills/wix-app/references/editor-react-component/DIRECTIONALITY.md +170 -0
- package/skills/wix-app/references/editor-react-component/EDIT-FLOW.md +6 -0
- package/skills/wix-app/references/editor-react-component/PARTS.md +25 -0
- package/skills/wix-app/references/editor-react-component/PROPS-VS-CSS.md +203 -0
- package/skills/wix-app/references/editor-react-component/REACT-GUIDELINES.md +167 -0
- package/skills/wix-app/references/editor-react-component/REACT-PATTERNS.md +137 -0
- package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +112 -0
- package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +118 -0
- package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +87 -0
- package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +86 -0
- package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +135 -0
- package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +79 -0
- package/skills/wix-app/references/service-plugin/VALIDATIONS.md +68 -0
- package/skills/wix-app/references/site-plugin/EXAMPLES.md +311 -0
- package/skills/wix-app/references/site-plugin/SLOTS.md +263 -0
- package/skills/wix-design-system/SKILL.md +129 -0
- package/skills/wix-design-system/references/file-structure.md +56 -0
- package/skills/wix-design-system/scripts/wds.cjs +531 -0
- package/skills/wix-headless/SKILL.md +418 -0
- package/skills/wix-headless/references/DISCOVERY.md +332 -0
- package/skills/wix-headless/references/ORCHESTRATION.md +269 -0
- package/skills/wix-headless/references/SETUP.md +154 -0
- package/skills/wix-headless/references/blog/BLOG_CONTENT.md +152 -0
- package/skills/wix-headless/references/blog/BLOG_PAGES.md +299 -0
- package/skills/wix-headless/references/blog/BLOG_SETUP.md +218 -0
- package/skills/wix-headless/references/blog/INSTRUCTIONS.md +32 -0
- package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +373 -0
- package/skills/wix-headless/references/cms/FAQ_KNOWLEDGE_BASE.md +229 -0
- package/skills/wix-headless/references/cms/INSTRUCTIONS.md +40 -0
- package/skills/wix-headless/references/cms/PORTFOLIO.md +454 -0
- package/skills/wix-headless/references/cms/RESOURCE_LIBRARY.md +356 -0
- package/skills/wix-headless/references/cms/TEAM_DIRECTORY.md +299 -0
- package/skills/wix-headless/references/commands/install-app.md +42 -0
- package/skills/wix-headless/references/commands/known-apps.json +5 -0
- package/skills/wix-headless/references/commands/mcp-bootstrap.md +28 -0
- package/skills/wix-headless/references/designer/INSTRUCTIONS.md +828 -0
- package/skills/wix-headless/references/ecom/CART_PAGES.md +120 -0
- package/skills/wix-headless/references/ecom/CART_WIRING.md +103 -0
- package/skills/wix-headless/references/ecom/COMPONENTS_CSS.md +132 -0
- package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +59 -0
- package/skills/wix-headless/references/forms/CONTACT_FORM.md +477 -0
- package/skills/wix-headless/references/forms/INSTRUCTIONS.md +43 -0
- package/skills/wix-headless/references/gift-cards/COMPONENTS.md +119 -0
- package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +51 -0
- package/skills/wix-headless/references/gift-cards/PAGES.md +129 -0
- package/skills/wix-headless/references/images/INSTRUCTIONS.md +359 -0
- package/skills/wix-headless/references/shared/BUILD_NOISE.md +8 -0
- package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +185 -0
- package/skills/wix-headless/references/shared/IMPLEMENTER.md +155 -0
- package/skills/wix-headless/references/shared/MCP_PREFIX.md +105 -0
- package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +97 -0
- package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +423 -0
- package/skills/wix-headless/references/shared/STYLING.md +117 -0
- package/skills/wix-headless/references/stores/BACK_IN_STOCK.md +178 -0
- package/skills/wix-headless/references/stores/CATEGORY_PAGES.md +86 -0
- package/skills/wix-headless/references/stores/COMPONENTS_CSS.md +129 -0
- package/skills/wix-headless/references/stores/HOME_AND_NAV.md +227 -0
- package/skills/wix-headless/references/stores/INSTRUCTIONS.md +96 -0
- package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +249 -0
- package/skills/wix-headless/references/stores/PRODUCT_PAGES.md +213 -0
- package/skills/wix-headless/references/stores/SHARED_WIRING.md +164 -0
- package/skills/wix-headless/references/verticals/_schema.json +160 -0
- package/skills/wix-headless/references/verticals/_schema.md +185 -0
- package/skills/wix-headless/references/verticals/blog.md +125 -0
- package/skills/wix-headless/references/verticals/cms.md +121 -0
- package/skills/wix-headless/references/verticals/ecom.md +96 -0
- package/skills/wix-headless/references/verticals/forms.md +106 -0
- package/skills/wix-headless/references/verticals/gift-cards.md +121 -0
- package/skills/wix-headless/references/verticals/stores.md +167 -0
- package/skills/wix-headless/scripts/check-manifest.mjs +198 -0
- package/skills/wix-headless/scripts/copy-utility-templates.mjs +153 -0
- package/skills/wix-headless/scripts/emit-design-tokens.mjs +77 -0
- package/skills/wix-headless/scripts/finalize-run-json.mjs +141 -0
- package/skills/wix-headless/scripts/init-site-json.mjs +63 -0
- package/skills/wix-headless/scripts/patch-decorative-slots.mjs +124 -0
- package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +190 -0
- package/skills/wix-headless/scripts/preview.sh +45 -0
- package/skills/wix-headless/scripts/release.sh +73 -0
- package/skills/wix-headless/scripts/scaffold.sh +53 -0
- package/skills/wix-headless/scripts/seed-utilities.sh +55 -0
- package/skills/wix-headless/shared-utilities/analytics.ts +40 -0
- package/skills/wix-headless/shared-utilities/ricos.ts +179 -0
- package/skills/wix-headless/shared-utilities/wix-image.ts +72 -0
- package/skills/wix-headless/templates/ecom/CartBadge.tsx +84 -0
- package/skills/wix-headless/templates/ecom/CartView.tsx +543 -0
- package/skills/wix-headless/templates/ecom/cart.astro +13 -0
- package/skills/wix-headless/templates/ecom/components-ecom.css +215 -0
- package/skills/wix-headless/templates/ecom/discounts.ts +71 -0
- package/skills/wix-headless/templates/ecom/thank-you.astro +24 -0
- package/skills/wix-headless/templates/gift-cards/GiftCardPurchase.tsx +172 -0
- package/skills/wix-headless/templates/gift-cards/_home-teaser-snippet.astro +42 -0
- package/skills/wix-headless/templates/gift-cards/_nav-snippet.astro +11 -0
- package/skills/wix-headless/templates/gift-cards/components-gift-cards.css +219 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.astro +51 -0
- package/skills/wix-headless/templates/gift-cards/gift-cards.ts +75 -0
- package/skills/wix-headless/templates/stores/AddToCartButton.tsx +77 -0
- package/skills/wix-headless/templates/stores/BackInStockForm.tsx +176 -0
- package/skills/wix-headless/templates/stores/CategoryRail.astro +69 -0
- package/skills/wix-headless/templates/stores/ProductCard.astro +79 -0
- package/skills/wix-headless/templates/stores/ProductPurchase.tsx +397 -0
- package/skills/wix-headless/templates/stores/SeoTags.astro +21 -0
- package/skills/wix-headless/templates/stores/back-in-stock.ts +67 -0
- package/skills/wix-headless/templates/stores/categories.ts +155 -0
- package/skills/wix-headless/templates/stores/category/[slug].astro +130 -0
- package/skills/wix-headless/templates/stores/components-stores.css +295 -0
- package/skills/wix-headless/templates/stores/products/[slug].astro +128 -0
- package/skills/wix-headless/templates/stores/products/index.astro +101 -0
- package/skills/wix-manage/SKILL.md +280 -0
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +155 -0
- package/skills/wix-manage/references/app-installation/list-installed-apps.md +124 -0
- package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +226 -0
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +95 -0
- package/skills/wix-manage/references/bookings/booking-system-integration-gaps.md +416 -0
- package/skills/wix-manage/references/bookings/bookings-staff-setup.md +255 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +462 -0
- package/skills/wix-manage/references/bookings/end-to-end-booking-flow.md +278 -0
- package/skills/wix-manage/references/bookings/external-calendar-integration.md +258 -0
- package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +231 -0
- package/skills/wix-manage/references/calendar/configure-default-business-hours.md +226 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +422 -0
- package/skills/wix-manage/references/cms/cms-data-operations-extended.md +263 -0
- package/skills/wix-manage/references/cms/cms-ecommerce-catalog-integration.md +136 -0
- package/skills/wix-manage/references/cms/cms-references-and-relationships.md +160 -0
- package/skills/wix-manage/references/cms/cms-schema-management.md +143 -0
- package/skills/wix-manage/references/contacts/bulk-delete-contacts.md +73 -0
- package/skills/wix-manage/references/contacts/bulk-label-and-unlabel-contacts.md +67 -0
- package/skills/wix-manage/references/domains/domain-search-and-purchase.md +434 -0
- package/skills/wix-manage/references/ecommerce/api-recommendation-tracking.md +420 -0
- package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +267 -0
- package/skills/wix-manage/references/ecommerce/flow-bundle-and-save.md +290 -0
- package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +300 -0
- package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +364 -0
- package/skills/wix-manage/references/ecommerce/flow-seasonal-promotion.md +315 -0
- package/skills/wix-manage/references/ecommerce/flow-stock-mover.md +308 -0
- package/skills/wix-manage/references/ecommerce/flow-upsell-boost.md +271 -0
- package/skills/wix-manage/references/ecommerce/goal-clear-inventory.md +118 -0
- package/skills/wix-manage/references/ecommerce/goal-drive-cross-sells.md +122 -0
- package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +132 -0
- package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +148 -0
- package/skills/wix-manage/references/ecommerce/goal-seasonal-revenue.md +146 -0
- package/skills/wix-manage/references/ecommerce/guardrail-discount-conflicts.md +118 -0
- package/skills/wix-manage/references/ecommerce/guardrail-margin-protection.md +88 -0
- package/skills/wix-manage/references/ecommerce/guardrail-rate-pricing-sanity.md +108 -0
- package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +124 -0
- package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +299 -0
- package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +582 -0
- package/skills/wix-manage/references/ecommerce/setup-coupons.md +338 -0
- package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +444 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-rates.md +86 -0
- package/skills/wix-manage/references/ecommerce/setup-shipping-regions.md +56 -0
- package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +209 -0
- package/skills/wix-manage/references/ecommerce/skill-graph.md +139 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-checkout-delivery-dropoff.md +124 -0
- package/skills/wix-manage/references/ecommerce/troubleshoot-discount-not-applying.md +95 -0
- package/skills/wix-manage/references/events/list-events.md +203 -0
- package/skills/wix-manage/references/forms/create-form.md +260 -0
- package/skills/wix-manage/references/get-paid/create-payment-links.md +212 -0
- package/skills/wix-manage/references/get-paid/how-to-setup-wix-payments.md +57 -0
- package/skills/wix-manage/references/get-paid/payment-links-for-bookings.md +101 -0
- package/skills/wix-manage/references/media/upload-media-to-wix.md +216 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +77 -0
- package/skills/wix-manage/references/pricing-plans/pricing-plans-bookings-integration.md +166 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +336 -0
- package/skills/wix-manage/references/rich-content/ricos-converter-service.md +295 -0
- package/skills/wix-manage/references/site-properties/change-payment-currency-site-properties.md +59 -0
- package/skills/wix-manage/references/sites/create-site-from-template.md +183 -0
- package/skills/wix-manage/references/sites/query-sites.md +125 -0
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +57 -0
- package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +1041 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v1.md +125 -0
- package/skills/wix-manage/references/stores/create-product-from-image.md +824 -0
- package/skills/wix-manage/references/stores/create-product-with-options-catalog-v3.md +566 -0
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +194 -0
- package/skills/wix-manage/references/stores/query-products-catalog-v1.md +80 -0
- package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +99 -0
- package/skills/wix-manage/references/stores/update-product-pre-order.md +213 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +318 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
|
|
2
|
+
# Wix Stores Catalog Versioning (V1 / V3)
|
|
3
|
+
|
|
4
|
+
Wix Stores has two catalog versions that are **NOT backwards compatible**. Apps **must support both** — single-version apps cannot list in the App Market and break on new sites.
|
|
5
|
+
|
|
6
|
+
| Version | Status | Modules |
|
|
7
|
+
|---------|--------|---------|
|
|
8
|
+
| **V1_CATALOG** | Legacy | `products`, `collections`, `inventory` |
|
|
9
|
+
| **V3_CATALOG** | Current | `productsV3`, `inventoryItemsV3`, `customizationsV3`, `ribbonsV3`, `brandsV3`, `infoSectionsV3` (all from `@wix/stores`); `categories` (from `@wix/categories`) |
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Mandatory: Detect Version First
|
|
14
|
+
|
|
15
|
+
**Every Stores flow must call `catalogVersioning.getCatalogVersion()` before any other Stores operation.** The version is permanent per site — cache it.
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { catalogVersioning, products, productsV3 } from '@wix/stores';
|
|
19
|
+
|
|
20
|
+
export type CatalogVersion = 'V1_CATALOG' | 'V3_CATALOG' | 'STORES_NOT_INSTALLED';
|
|
21
|
+
let cached: CatalogVersion | undefined;
|
|
22
|
+
|
|
23
|
+
export async function getVersion(): Promise<CatalogVersion> {
|
|
24
|
+
if (cached) return cached;
|
|
25
|
+
const { catalogVersion } = await catalogVersioning.getCatalogVersion();
|
|
26
|
+
cached = catalogVersion as CatalogVersion;
|
|
27
|
+
return cached;
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Handle `STORES_NOT_INSTALLED` gracefully — return empty results, do not throw.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Module Map (V1 → V3)
|
|
36
|
+
|
|
37
|
+
| Concern | V1 (`@wix/stores`) | V3 (`@wix/stores` unless noted) |
|
|
38
|
+
|---------|--------------------|--------------------------------|
|
|
39
|
+
| Catalog version | `catalogVersioning` | `catalogVersioning` (same) |
|
|
40
|
+
| Products CRUD | `products` | `productsV3` |
|
|
41
|
+
| Inventory | `inventory` | `inventoryItemsV3` |
|
|
42
|
+
| Collections / Categories | Read: `collections`. **Write ops live on `products`** (`createCollection`, `updateCollection`, `addProductsToCollection`, …) | `@wix/categories` → `categories` |
|
|
43
|
+
| Custom text fields | `customTextFields` on product | `customizationsV3` (FREE_TEXT modifier) |
|
|
44
|
+
| Ribbons | inline `ribbon` string | `ribbonsV3` |
|
|
45
|
+
| Brand | inline `brand` string | `brandsV3` |
|
|
46
|
+
| Info sections | inline `additionalInfoSections` | `infoSectionsV3` |
|
|
47
|
+
| Subscriptions | dedicated subscriptions API | inline `subscriptionDetails` on product |
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Permissions
|
|
52
|
+
|
|
53
|
+
**Always include `SCOPE.STORES.CATALOG_READ_LIMITED`** — required by `getCatalogVersion()`. Request **both** V1 and V3 scopes for any operation you implement on both code paths.
|
|
54
|
+
|
|
55
|
+
| Operation | V1 scope | V3 scope |
|
|
56
|
+
|-----------|----------|----------|
|
|
57
|
+
| Get catalog version | `SCOPE.STORES.CATALOG_READ_LIMITED` | `SCOPE.STORES.CATALOG_READ_LIMITED` |
|
|
58
|
+
| Read products | `SCOPE.DC-STORES.READ-PRODUCTS` | `SCOPE.STORES.PRODUCT_READ` |
|
|
59
|
+
| Read hidden products / merchant data | `SCOPE.DC-STORES.READ-PRODUCTS` | `SCOPE.STORES.PRODUCT_READ_ADMIN` |
|
|
60
|
+
| Create / update / delete products | `SCOPE.DC-STORES.MANAGE-PRODUCTS` | `SCOPE.STORES.PRODUCT_WRITE` |
|
|
61
|
+
| Read inventory | `SCOPE.DC-STORES.READ-PRODUCTS` | `SCOPE.STORES.INVENTORY_ITEM_READ` |
|
|
62
|
+
| Update inventory | `SCOPE.DC-STORES.MANAGE-PRODUCTS` | `SCOPE.STORES.INVENTORY_ITEM_WRITE` |
|
|
63
|
+
| Read orders (unchanged) | `SCOPE.DC-STORES.READ-ORDERS` | `SCOPE.DC-STORES.READ-ORDERS` |
|
|
64
|
+
| Manage collections (V1) / categories (V3) | `SCOPE.DC-STORES.MANAGE-PRODUCTS` | `SCOPE.CATEGORIES.CATEGORY_WRITE` |
|
|
65
|
+
| Read categories (V3) | — | `SCOPE.CATEGORIES.CATEGORY_READ` |
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Major V3 Behavior Changes (gotchas)
|
|
70
|
+
|
|
71
|
+
1. **Every product has at least one variant.** `manageVariants` is gone. Single-variant products still expose price/sku via `variantsInfo.variants[0]`.
|
|
72
|
+
2. **`revision` required on update.** V3 uses optimistic concurrency — fetch current `revision`, pass it back. Each update increments it.
|
|
73
|
+
3. **Array fields overwrite, don't merge.** When updating `options`, `modifiers`, or `variantsInfo.variants`, send the entire array. `options` and `variantsInfo.variants` are coupled — update one, update the other.
|
|
74
|
+
4. **`queryProducts` (V3) does not return variants.** Use `getProduct` or the Read-Only Variants API.
|
|
75
|
+
5. **Hidden products require `SCOPE.STORES.PRODUCT_READ_ADMIN`** for V3 reads. The basic read scope only sees `visible: true`.
|
|
76
|
+
6. **Requested fields**: V3 needs `'CURRENCY'`, `'MERCHANT_DATA'`, `'URL'`, `'INFO_SECTION'`, etc. in the `fields` array to populate those fields.
|
|
77
|
+
7. **Prices are strings in V3, numbers in V1.** Enums are **UPPER_CASE in V3, lower-case in V1** (`PHYSICAL` vs `physical`).
|
|
78
|
+
8. **Categories require a `treeReference`** (`appNamespace` + `treeKey`) — V1 collections did not.
|
|
79
|
+
9. **V3 paging is cursor-only — no offset, no total count.** The V3 builder uses `.skipTo(cursor)` (not V1's `.skip(n)`), and the result has `cursors.next` + `hasNext()` but no `totalCount`. Don't build "page X of Y" UI for V3 — use Next/Previous.
|
|
80
|
+
10. **V3 product sort fields fail at runtime even when TypeScript accepts them.** TS allows `'_createdDate' | '_updatedDate' | 'slug' | 'visible'`, but real V3 sites return `Field '_createdDate' is not declared as sortable`. **Omit `sort` on V3 product queries** unless verified on a live V3 site.
|
|
81
|
+
11. **Stock status is UPPER_SNAKE_CASE on both versions** — `IN_STOCK`, `OUT_OF_STOCK`, `PARTIALLY_OUT_OF_STOCK`, plus `PREORDER` on V3. Never compare against lowercase.
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Copy-Paste Recipes
|
|
86
|
+
|
|
87
|
+
Each recipe handles both versions. `V3Product` and V1 `Product` types are **not** re-exported from `@wix/stores` top-level — let TS infer or use structural types.
|
|
88
|
+
|
|
89
|
+
### List products with pagination
|
|
90
|
+
|
|
91
|
+
Both versions expose a fluent query builder, but the paging method differs:
|
|
92
|
+
|
|
93
|
+
| Aspect | V1 (`products.queryProducts()`) | V3 (`productsV3.queryProducts()`) |
|
|
94
|
+
|--------|--------------------------------|----------------------------------|
|
|
95
|
+
| API style | Fluent builder: `.skip().limit().find()` | Fluent builder: `.skipTo(cursor).limit().find()` |
|
|
96
|
+
| Pagination | Offset (`.skip(n)`) | Cursor (`.skipTo(cursor)`) |
|
|
97
|
+
| Result `items` | `res.items` (V1 `Product[]`) | `res.items` (V3 `Product[]`) |
|
|
98
|
+
| Total count | `res.totalCount` | **None** — V3 only has `cursors.next` + `hasNext()` |
|
|
99
|
+
| `hasNext` | `res.hasNext()` (method) | `res.hasNext()` (method) |
|
|
100
|
+
| Next cursor | n/a | `res.cursors.next` (string) |
|
|
101
|
+
|
|
102
|
+
```typescript
|
|
103
|
+
import { catalogVersioning, products, productsV3 } from '@wix/stores';
|
|
104
|
+
|
|
105
|
+
export interface ProductsPage {
|
|
106
|
+
products: unknown[]; // narrow at call site
|
|
107
|
+
nextCursor: string | null; // V3 only
|
|
108
|
+
hasNext: boolean;
|
|
109
|
+
totalCount: number | null; // V1 only
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export async function listProductsPage(
|
|
113
|
+
limit: number,
|
|
114
|
+
cursorOrSkip: string | number | undefined,
|
|
115
|
+
): Promise<ProductsPage> {
|
|
116
|
+
const v = await getVersion();
|
|
117
|
+
if (v === 'STORES_NOT_INSTALLED') {
|
|
118
|
+
return { products: [], nextCursor: null, hasNext: false, totalCount: 0 };
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (v === 'V3_CATALOG') {
|
|
122
|
+
let builder = productsV3.queryProducts().limit(limit);
|
|
123
|
+
if (typeof cursorOrSkip === 'string') builder = builder.skipTo(cursorOrSkip);
|
|
124
|
+
// Do NOT chain a sort — see gotcha #10.
|
|
125
|
+
const res = await builder.find();
|
|
126
|
+
return {
|
|
127
|
+
products: res.items,
|
|
128
|
+
nextCursor: res.cursors.next ?? null,
|
|
129
|
+
hasNext: res.hasNext(),
|
|
130
|
+
totalCount: null,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const skip = typeof cursorOrSkip === 'number' ? cursorOrSkip : 0;
|
|
135
|
+
const res = await products.queryProducts().skip(skip).limit(limit).find();
|
|
136
|
+
return {
|
|
137
|
+
products: res.items,
|
|
138
|
+
nextCursor: null,
|
|
139
|
+
hasNext: res.hasNext(),
|
|
140
|
+
totalCount: res.totalCount ?? null,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
> **Two ways to call V3 `queryProducts`:** the canonical builder shown above, and a direct-call form `productsV3.queryProducts({ cursorPaging: { limit, cursor } })` returning a `Promise<{ products, pagingMetadata }>`. Both compile and run, but the builder is more idiomatic and matches V1's shape.
|
|
146
|
+
|
|
147
|
+
### Display price/stock without fetching variants
|
|
148
|
+
|
|
149
|
+
V3 `queryProducts` does not return variants. Read product-level rollup fields instead:
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
function displayPrice(p: { actualPriceRange?: { minValue?: { amount?: string }; maxValue?: { amount?: string } } }): string {
|
|
153
|
+
const min = p.actualPriceRange?.minValue?.amount;
|
|
154
|
+
const max = p.actualPriceRange?.maxValue?.amount;
|
|
155
|
+
if (!min) return '—';
|
|
156
|
+
return max && max !== min ? `${min} – ${max}` : min;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function stockLabel(status: string | undefined): string {
|
|
160
|
+
switch (status) {
|
|
161
|
+
case 'IN_STOCK': return 'In Stock';
|
|
162
|
+
case 'OUT_OF_STOCK': return 'Out of Stock';
|
|
163
|
+
case 'PARTIALLY_OUT_OF_STOCK': return 'Limited';
|
|
164
|
+
case 'PREORDER': return 'Pre-order';
|
|
165
|
+
default: return '—';
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// V1 path: product.stock.inventoryStatus (same UPPER_SNAKE_CASE values)
|
|
169
|
+
// V3 path: product.inventory.availabilityStatus (adds PREORDER)
|
|
170
|
+
// SKU lives on the variant — show "—" in lists, or use Read-Only Variants API.
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Get a single product
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
if (v === 'V3_CATALOG') {
|
|
177
|
+
const product = await productsV3.getProduct(id); // returns Product directly
|
|
178
|
+
return product;
|
|
179
|
+
}
|
|
180
|
+
const { product } = await products.getProduct(id); // V1 wraps in { product }
|
|
181
|
+
return product;
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Create a product (single-variant, with price)
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
if (v === 'V3_CATALOG') {
|
|
188
|
+
const product = await productsV3.createProduct({
|
|
189
|
+
name: 'My Product',
|
|
190
|
+
productType: 'PHYSICAL', // UPPER_CASE
|
|
191
|
+
variantsInfo: {
|
|
192
|
+
variants: [{
|
|
193
|
+
price: { actualPrice: { amount: '19.99' } }, // string, on the variant
|
|
194
|
+
sku: 'SKU-001',
|
|
195
|
+
}],
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
return product;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const { product } = await products.createProduct({
|
|
202
|
+
name: 'My Product',
|
|
203
|
+
productType: 'physical', // lower-case
|
|
204
|
+
priceData: { price: 19.99 }, // number, on the product
|
|
205
|
+
sku: 'SKU-001',
|
|
206
|
+
});
|
|
207
|
+
return product;
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Update a product (V3 needs `revision`)
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
if (v === 'V3_CATALOG') {
|
|
214
|
+
// Signature: updateProduct(_id, productFields). Returns Product directly.
|
|
215
|
+
const current = await productsV3.getProduct(id);
|
|
216
|
+
if (current.revision == null) throw new Error(`Product ${id} has no revision`);
|
|
217
|
+
return await productsV3.updateProduct(id, {
|
|
218
|
+
revision: current.revision, // narrowed — required under exactOptionalPropertyTypes
|
|
219
|
+
name: 'New name',
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
// V1: updateProduct(id, productFields). Returns { product }.
|
|
223
|
+
const { product } = await products.updateProduct(id, { name: 'New name' });
|
|
224
|
+
return product;
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Delete a product
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
if (v === 'V3_CATALOG') await productsV3.deleteProduct(id);
|
|
231
|
+
else await products.deleteProduct(id);
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Inventory: increment stock
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
import { inventory, inventoryItemsV3 } from '@wix/stores';
|
|
238
|
+
|
|
239
|
+
if (v === 'V3_CATALOG') {
|
|
240
|
+
// Per-variant; flat shape.
|
|
241
|
+
await inventoryItemsV3.bulkIncrementInventoryItems([
|
|
242
|
+
{ inventoryItemId, incrementBy: 5 },
|
|
243
|
+
]);
|
|
244
|
+
} else {
|
|
245
|
+
// Per-product (variant optional).
|
|
246
|
+
await inventory.incrementInventory([
|
|
247
|
+
{ productId, variantId, incrementBy: 5 },
|
|
248
|
+
]);
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
To find a V3 inventory item ID, use `inventoryItemsV3.searchInventoryItems` filtered by `productId` / `variantId`.
|
|
253
|
+
|
|
254
|
+
### Query inventory
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
if (v === 'V3_CATALOG') {
|
|
258
|
+
const res = await inventoryItemsV3.queryInventoryItems().eq('productId', productId).find();
|
|
259
|
+
return res.items;
|
|
260
|
+
}
|
|
261
|
+
// V1: filter is a JSON-stringified expression.
|
|
262
|
+
const res = await inventory.queryInventory({
|
|
263
|
+
query: { filter: JSON.stringify({ productId }) },
|
|
264
|
+
});
|
|
265
|
+
return res.inventoryItems;
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Collections (V1) ↔ Categories (V3)
|
|
269
|
+
|
|
270
|
+
```typescript
|
|
271
|
+
// V1 write ops (createCollection, updateCollection, addProductsToCollection, …)
|
|
272
|
+
// live on the `products` namespace, NOT `collections`. The `collections` namespace is read-only.
|
|
273
|
+
import { products } from '@wix/stores';
|
|
274
|
+
import { categories } from '@wix/categories';
|
|
275
|
+
|
|
276
|
+
if (v === 'V3_CATALOG') {
|
|
277
|
+
// V3 createCategory(category, options). treeReference is REQUIRED and goes in `options`.
|
|
278
|
+
// For Wix Stores categories: appNamespace MUST be the literal "@wix/stores", treeKey is null.
|
|
279
|
+
const category = await categories.createCategory(
|
|
280
|
+
{ name: 'Sale' },
|
|
281
|
+
{ treeReference: { appNamespace: '@wix/stores', treeKey: null } },
|
|
282
|
+
);
|
|
283
|
+
return category;
|
|
284
|
+
}
|
|
285
|
+
const { collection } = await products.createCollection({ name: 'Sale' }); // V1 returns { collection }
|
|
286
|
+
return collection;
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
V3 categories are tree-structured. Reference them on a product via `directCategories[]`, not `collectionIds[]`. **All Stores category API calls must pass `treeReference: { appNamespace: '@wix/stores', treeKey: null }` in `options`** — applies to `createCategory`, `updateCategory`, `queryCategories`, etc.
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## V1 → V3 Field Mapping (most common)
|
|
294
|
+
|
|
295
|
+
For the full table see the [Catalog V1 to V3 Migration Guide](https://dev.wix.com/docs/api-reference/business-solutions/stores/catalog-v3/catalog-v1-to-v3-migration-guide?apiView=SDK).
|
|
296
|
+
|
|
297
|
+
| V1 | V3 |
|
|
298
|
+
|----|----|
|
|
299
|
+
| `priceData.price` (no discount) | `variantsInfo.variants[i].price.actualPrice.amount` |
|
|
300
|
+
| `priceData.price` (with discount) | `variantsInfo.variants[i].price.compareAtPrice.amount` |
|
|
301
|
+
| `priceData.discountedPrice` | `variantsInfo.variants[i].price.actualPrice.amount` |
|
|
302
|
+
| `priceData.currency` | `currency` (top-level, requested field) |
|
|
303
|
+
| `sku`, `weight` (single variant) | `variantsInfo.variants[0].sku` / `physicalProperties.weight` |
|
|
304
|
+
| `stock.quantity`, `stock.trackInventory` | Inventory Items API (`inventoryItemsV3`) |
|
|
305
|
+
| `stock.inventoryStatus` | `inventory.availabilityStatus` |
|
|
306
|
+
| `productType: "physical"` | `productType: "PHYSICAL"` (upper-case) |
|
|
307
|
+
| `additionalInfoSections[i]` | `infoSections[i]` (now requires `uniqueName`) |
|
|
308
|
+
| `customTextFields[i]` | `modifiers[i]` with `freeTextSettings` |
|
|
309
|
+
| `manageVariants: true` (creates variants) | `options[i]` |
|
|
310
|
+
| `manageVariants: false` (customizations) | `modifiers[i]` |
|
|
311
|
+
| `collectionIds[i]` | `directCategories[i].id` |
|
|
312
|
+
| `ribbon`, `brand` (string) | `ribbon.name`, `brand.name` (managed via `ribbonsV3` / `brandsV3`) |
|
|
313
|
+
|
|
314
|
+
**Pricing model** — V1 had a `discount` object; V3 removed it. Discounts are now expressed by the relationship between two fields on the variant: `actualPrice` (required, what the customer pays) vs `compareAtPrice` (optional, original price shown struck through). With discount: V1 `price`/`discountedPrice` → V3 `compareAtPrice`/`actualPrice`. Without discount: V1 `price` → V3 `actualPrice`, leave `compareAtPrice` empty.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## Webhooks
|
|
319
|
+
|
|
320
|
+
**Subscribe to BOTH V1 and V3 webhooks** so your app handles every site.
|
|
321
|
+
|
|
322
|
+
| V1 event | V3 event |
|
|
323
|
+
|----------|----------|
|
|
324
|
+
| `products.onProductCreated` / `onProductChanged` / `onProductDeleted` | `productsV3.onProductCreated` / `onProductUpdated` / `onProductDeleted` |
|
|
325
|
+
| `products.onProductVariantsChanged` | `productsV3.onProductUpdated` (with `variantsInfo` in `modifiedFields`) |
|
|
326
|
+
| `products.onProductCollectionCreated` / `onProductCollectionChanged` / `onProductCollectionDeleted` (yes — the collection webhooks live on the `products` namespace) | `categories.onCategoryCreated` / `onCategoryUpdated` / `onCategoryDeleted` |
|
|
327
|
+
|
|
328
|
+
Payload changes: V1 `changedFields` → V3 `modifiedFields`. Top-level `entityId` on all V3 payloads. V1 created-event entity → V3 `createdEvent.entityAsJson`. Order webhooks are unchanged — use `@wix/ecom` → `orders`.
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Falling back to MCP
|
|
333
|
+
|
|
334
|
+
This file covers the common 80%. For methods not listed (subscriptions, brands, ribbons, etc.) or full request schemas, use `SearchWixSDKDocumentation` then `ReadFullDocsArticle`. Always return the required permission scopes to the user.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# Common Wix Events for CLI Event Extensions
|
|
2
|
+
|
|
3
|
+
This reference lists common event types, SDK imports, permissions, and links. For full payload shapes and additional events, see the [JavaScript SDK reference](https://dev.wix.com/docs/sdk).
|
|
4
|
+
|
|
5
|
+
## CRM Events
|
|
6
|
+
|
|
7
|
+
| Event | Import | Handler Call | Permission | API Reference |
|
|
8
|
+
| --- | --- | --- | --- | --- |
|
|
9
|
+
| Contact created | `import { contacts } from "@wix/crm"` | `contacts.onContactCreated(handler)` | `SCOPE.DC-CONTACTS.READ-CONTACTS` | [onContactCreated](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/contact-v4/contact-created?apiView=SDK) |
|
|
10
|
+
| Contact updated | `import { contacts } from "@wix/crm"` | `contacts.onContactUpdated(handler)` | `SCOPE.DC-CONTACTS.READ-CONTACTS` | [onContactUpdated](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/contact-v4/contact-updated?apiView=SDK) |
|
|
11
|
+
| Contact deleted | `import { contacts } from "@wix/crm"` | `contacts.onContactDeleted(handler)` | `SCOPE.DC-CONTACTS.READ-CONTACTS` | [onContactDeleted](https://dev.wix.com/docs/api-reference/crm/members-contacts/contacts/contacts/contact-v4/contact-deleted?apiView=SDK) |
|
|
12
|
+
|
|
13
|
+
**Example – contact created:**
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { contacts } from "@wix/crm";
|
|
17
|
+
|
|
18
|
+
export default contacts.onContactCreated((event) => {
|
|
19
|
+
const contact = event.entity;
|
|
20
|
+
console.log("New contact:", contact._id, contact.primaryInfo?.email);
|
|
21
|
+
});
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## eCommerce Events
|
|
25
|
+
|
|
26
|
+
| Event | Import | Handler Call | Permission | API Reference |
|
|
27
|
+
| --- | --- | --- | --- | --- |
|
|
28
|
+
| Order created | `import { orders } from "@wix/ecom"` | `orders.onOrderCreated(handler)` | `SCOPE.DC-STORES.READ-ORDERS` | [onOrderCreated](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders/order-created?apiView=SDK) |
|
|
29
|
+
| Order approved | `import { orders } from "@wix/ecom"` | `orders.onOrderApproved(handler)` | `SCOPE.DC-STORES.READ-ORDERS` | [onOrderApproved](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/orders/order-approved?apiView=SDK) |
|
|
30
|
+
| Cart created | `import { cart } from "@wix/ecom"` | `cart.onCartCreated(handler)` | `SCOPE.DC-STORES.READ-ORDERS` | [onCartCreated](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart/cart/cart-created?apiView=SDK) |
|
|
31
|
+
| Cart updated | `import { cart } from "@wix/ecom"` | `cart.onCartUpdated(handler)` | `SCOPE.DC-STORES.READ-ORDERS` | [onCartUpdated](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/purchase-flow/cart/cart/cart-updated?apiView=SDK) |
|
|
32
|
+
|
|
33
|
+
**Example – order approved:**
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
import { orders } from "@wix/ecom";
|
|
37
|
+
|
|
38
|
+
export default orders.onOrderApproved(async (event) => {
|
|
39
|
+
const order = event.data.order;
|
|
40
|
+
console.log("Order approved:", order._id);
|
|
41
|
+
});
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Bookings Events
|
|
45
|
+
|
|
46
|
+
| Event | Import | Handler Call | Permission | API Reference |
|
|
47
|
+
| --- | --- | --- | --- | --- |
|
|
48
|
+
| Booking confirmed | `import { bookings } from "@wix/bookings"` | `bookings.onBookingConfirmed(handler)` | `SCOPE.DC-BOOKINGS.READ-CALENDAR-WITH-PARTICIPANTS` | [onBookingConfirmed](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/booking-confirmed?apiView=SDK) |
|
|
49
|
+
| Booking canceled | `import { bookings } from "@wix/bookings"` | `bookings.onBookingCanceled(handler)` | `SCOPE.DC-BOOKINGS.READ-CALENDAR-WITH-PARTICIPANTS` | [onBookingCanceled](https://dev.wix.com/docs/api-reference/business-solutions/bookings/bookings/bookings-writer-v2/booking-canceled?apiView=SDK) |
|
|
50
|
+
|
|
51
|
+
**Example – booking confirmed:**
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import { bookings } from "@wix/bookings";
|
|
55
|
+
|
|
56
|
+
export default bookings.onBookingConfirmed((event) => {
|
|
57
|
+
const booking = event.data.booking;
|
|
58
|
+
console.log("Booking confirmed:", booking._id);
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Blog Events
|
|
63
|
+
|
|
64
|
+
| Event | Import | Handler Call | Permission | API Reference |
|
|
65
|
+
| --- | --- | --- | --- | --- |
|
|
66
|
+
| Post created | `import { posts } from "@wix/blog"` | `posts.onPostCreated(handler)` | `SCOPE.DC-BLOG.READ-BLOGS` | [onPostCreated](https://dev.wix.com/docs/api-reference/business-solutions/blog/posts-stats/post-created?apiView=SDK) |
|
|
67
|
+
| Post updated | `import { posts } from "@wix/blog"` | `posts.onPostUpdated(handler)` | `SCOPE.DC-BLOG.READ-BLOGS` | [onPostUpdated](https://dev.wix.com/docs/api-reference/business-solutions/blog/posts-stats/post-updated?apiView=SDK) |
|
|
68
|
+
|
|
69
|
+
**Example – post created:**
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { posts } from "@wix/blog";
|
|
73
|
+
|
|
74
|
+
export default posts.onPostCreated((event) => {
|
|
75
|
+
const post = event.entity;
|
|
76
|
+
console.log("Post created:", post._id, post.title);
|
|
77
|
+
});
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Payload Shape
|
|
81
|
+
|
|
82
|
+
The event envelope structure varies by API — the path to the main entity differs (e.g., `event.entity`, `event.data.order`). Use TypeScript and your IDE for autocomplete and type safety. See each event's API reference link above for the exact payload shape.
|
|
83
|
+
|
|
84
|
+
All envelopes include a **metadata** object with context such as event ID, entity ID, timestamp, and instance ID.
|