# AGENTS Source: https://docs.virtual.fit/AGENTS > For Mintlify product knowledge (components, configuration, writing standards), > install the Mintlify skill: `npx skills add https://mintlify.com/docs` # Documentation project instructions ## About this project * This is a documentation site built on [Mintlify](https://mintlify.com) * Pages are MDX files with YAML frontmatter * Configuration lives in `docs.json` * Use the Mintlify MCP server, `https://mcp.mintlify.com`, to edit content and settings via MCP * Use the Mintlify docs MCP server, `https://www.mintlify.com/docs/mcp`, to query information about using Mintlify via MCP ## Terminology * Write the product name as `virtual.fit`. * Use **virtual.fit** or **dashboard** for the merchant experience. * Use **fitting room** for the storefront experience and **try-on** for one generated preview. * Use **shopper** for the merchant's customer. * Preserve `window.bitstudio`, `window.BitStudio`, and `bitstudio-*` as compatibility identifiers. * Do not use `bitStudio` as the product name in new prose. ## Style preferences * Use active voice and second person ("you") * Keep sentences concise — one idea per sentence * Use sentence case for headings * Bold for UI elements: Click **Settings** * Code formatting for file names, commands, paths, and code references ## Content boundaries * Document merchant-facing Shopify and Custom JavaScript integration workflows. * Document public storefront behavior and supported browser APIs. * Do not document internal admin tools, deployment scripts, private credentials, or implementation-only endpoints. * Treat virtual.fit as the source of truth for product availability, access limits, and shopper settings. # Browser API Source: https://docs.virtual.fit/custom-js/browser-api Reference the virtual.fit initialization, context, identity, consent, and tracking commands. The hosted loader exposes a command API through `window.virtualfit`. Define the queue before loading the script so early commands replay in order. ```javascript theme={null} window.virtualfit = window.virtualfit || function () { (window.virtualfit.q = window.virtualfit.q || []).push(arguments); }; ``` ## `init` Initialize one storefront configuration. ```javascript theme={null} virtualfit('init', { siteKey: 'site_pub_your_key', mount: '.product-media' }); ``` `siteKey` is required. Calling `init` starts product matching and keeps it current as the page URL changes. See [Loader configuration](/custom-js/configuration) for all fields. ## `setContext` Patch multiple parts of the active configuration. ```javascript theme={null} virtualfit('setContext', { product: { id: 'sku-10042', handle: 'linen-midi-dress' }, customer: { id: 'customer-8421' } }); ``` Use `setContext` when a single application state update changes both product and customer context. ## `setProduct` Set or replace the current product and optional exact variant context. ```javascript theme={null} virtualfit('setProduct', { id: 'dress-10042', handle: 'linen-midi-dress', title: 'Linen Midi Dress', imageUrl: 'https://cdn.example.com/linen-midi-dress.jpg' }); ``` ```javascript theme={null} virtualfit('setProduct', { id: 'dress-10042', handle: 'linen-midi-dress', title: 'Linen Midi Dress', imageUrl: 'https://cdn.example.com/linen-midi-dress.jpg', variantId: 'linen-black-petite-2', variantImageUrl: 'https://cdn.example.com/linen-black.jpg' }); ``` Provide `id` or `handle`. The value must resolve to a synced, enabled product with usable garment images. Stable product ID used during catalog sync. Synced product handle. Provide `id` or `handle`; providing both is recommended. Current shopper-facing product title. Display fallback for the current product. It does not override prepared catalog media. Exact `source_variant_id` synced under this product. Use it when the shopper has selected a specific variant. Optional display hint for the selected variant. virtual.fit verifies the variant against the synced product and uses canonical prepared variant media for try-on. Call `setProduct` after an SPA commits a product route when URL detection cannot identify the product. Call it again when the product or selected variant changes. Keep `id` stable across all variants of one product. Use `variantId` for the exact color, style, fit, and size combination. A size-only variant can reuse the product's shared prepared media. A color or pattern variant uses its own prepared media when you synced it. A variant ID must belong to the supplied product and must be available when availability is known. An unknown, mismatched, or unavailable variant fails with an actionable error instead of silently using the wrong garment. ## `setCustomer` Update shopper identity after login, logout, or account switching. ```javascript theme={null} virtualfit('setCustomer', { id: 'customer-8421', email: 'shopper@example.com' }); ``` Clear identity on logout: ```javascript theme={null} virtualfit('setCustomer', { id: '', email: '' }); ``` Set customer context as early as possible so try-on and commerce events join to the same shopper journey. ## `setConsentMode` Choose whether analytics may include shopper identity. ```javascript theme={null} virtualfit('setConsentMode', 'cookieless'); ``` Supported values: | Value | Behavior | | ------------ | ----------------------------------------------------------------- | | `consented` | Analytics may include the resolved shopper identity. | | `cookieless` | Analytics omits shopper identity and uses cookieless measurement. | Call this when your consent manager initializes and whenever the shopper changes analytics consent. ```javascript theme={null} consentManager.onChange(({ analyticsAllowed }) => { virtualfit( 'setConsentMode', analyticsAllowed ? 'consented' : 'cookieless' ); }); ``` See [Privacy and consent](/operations/privacy-and-consent). ## `recommend` Request hydrated products for a storefront placement: ```javascript theme={null} const result = await virtualfit('recommend', { intent: 'likely_purchases', excludeProductIds: ['sold-out-belt'], limit: 8 }); renderRecommendations(result.items); ``` Use `similar` for same-category alternatives, `complete_the_look` for the next category in an outfit, and `likely_purchases` for general “You may also like” or cart recommendations. If `intent` is omitted, the browser API defaults to `likely_purchases`. The hosted browser API supplies shopper identity automatically and keeps the existing merchant order if a recommendation request is rate-limited. See the [Recommendations API rate limits](/recommendations/api#rate-limits) for backend integrations. virtual.fit automatically uses the active product and products selected in the fitting room. `likely_purchases` can return products from categories already represented in the context. Pass the latest cart contents as `cartProductIds`. This augments the automatically resolved current product and fitting-room selection: ```javascript theme={null} const result = await virtualfit('recommend', { intent: 'likely_purchases', cartProductIds: ['linen-shirt', 'tailored-trousers'], excludeProductIds: ['sold-out-belt'] }); ``` Send the complete current cart, including an empty array after the shopper removes its last item. An explicit `cartProductIds` value is authoritative for that call. On a single-page storefront, you may call `recommend` immediately after `setProduct` or a product-bearing `setContext` call. The loader waits for the newest product resolution, so the request cannot fall back to the previously mounted product. To replace all automatically resolved context instead, pass `productIds`: ```javascript theme={null} const result = await virtualfit('recommend', { intent: 'complete_the_look', productIds: ['linen-shirt', 'tailored-trousers'], excludeProductIds: ['sold-out-belt', 'hidden-accessory'] }); ``` `productIds` must contain one to five outfit IDs for `complete_the_look` and exactly one ID for `similar`. For `likely_purchases`, it may contain zero to five IDs: `productIds: []` deliberately suppresses automatic page and fitting-room context so a supplied `cartProductIds` array can be the entire request context. A non-array value is rejected. `selectedProductIds`, `cartProductIds`, and `excludeProductIds` must also be arrays when supplied. `excludeProductIds` is a hard per-request override and accepts up to 500 IDs. Context products are always excluded automatically. ## Copy-paste recommendation placements Call `recommend` after the hosted loader is ready. Giving the loader script an ID makes that easy on a server-rendered storefront: ```html theme={null} ``` Keep the queued `virtualfit('init', ...)` block before the loader, as shown in the [Custom JavaScript quickstart](/custom-js/quickstart). ### Product page: similar products The current synced product is supplied automatically. This example renders a basic accessible row and leaves the placement hidden if recommendations are unavailable: ```html theme={null} ``` ### Cart drawer: likely purchases Always read the full live cart after an add, removal, quantity change, or checkout. `productIds: []` makes this a cart-only request instead of also using the product page behind the drawer: ```javascript theme={null} let cartRecommendationRequest = 0; async function refreshCartRecommendations(cart) { const request = ++cartRecommendationRequest; const cartProductIds = cart.items.map((item) => String(item.productId)); if (cartProductIds.length === 0) { renderCartRecommendations([]); return; } try { const result = await window.VirtualFit.recommend({ intent: 'likely_purchases', productIds: [], cartProductIds, excludeProductIds: unavailableProductIds, limit: 8 }); if (request !== cartRecommendationRequest) return; renderCartRecommendations( result.fallbackUsed ? existingMerchandisingFallback : result.items ); } catch (error) { if (request !== cartRecommendationRequest) return; renderCartRecommendations(existingMerchandisingFallback); } } whenVirtualFitReady(() => { cartStore.subscribe((cart) => { refreshCartRecommendations(cart); }); }); ``` Omit `productIds: []` when you want the current product or fitting-room selection to augment the cart instead. The request counter prevents a slower response for an older cart from replacing recommendations for the latest cart. ### Custom outfit builder: complete the look Send the complete current outfit whenever a shopper adds or removes an item. The first product is treated as the primary outfit item and all supplied products are excluded from results automatically: ```javascript theme={null} let outfitRecommendationRequest = 0; async function refreshOutfitRecommendations(selectedProducts) { const request = ++outfitRecommendationRequest; const productIds = selectedProducts .map((product) => String(product.id)) .slice(0, 5); if (productIds.length === 0) { renderOutfitRecommendations([]); return; } try { const result = await window.VirtualFit.recommend({ intent: 'complete_the_look', productIds, excludeProductIds: hiddenOrUnavailableProductIds, limit: 8 }); if (request !== outfitRecommendationRequest) return; renderOutfitRecommendations(result.items); } catch (error) { if (request !== outfitRecommendationRequest) return; renderOutfitRecommendations([]); } } ``` An empty `items` array is a valid result when there is no compatible open outfit category. Hide the row instead of replacing it with unrelated products. ### Load another page Pass the returned cursor with the same context and intent: ```javascript theme={null} const firstPage = await window.VirtualFit.recommend({ intent: 'likely_purchases', cartProductIds: currentCartProductIds, limit: 8 }); if (firstPage.nextCursor) { const nextPage = await window.VirtualFit.recommend({ intent: 'likely_purchases', cartProductIds: currentCartProductIds, cursor: firstPage.nextCursor, limit: 8 }); appendRecommendationCards(nextPage.items); } ``` The promise resolves to: ```javascript theme={null} { items: [ { product_id: 'leather-loafer', target_type: 'variant', variant_id: 'leather-loafer-black-38', rank: 1, score: 1.274, title: 'Leather Loafer', preview_image_url: 'https://cdn.example.com/loafer.jpg' } ], nextCursor: null, fallbackUsed: false } ``` Items are in display order, and `rank` is authoritative. `score` is optional and meaningful only within that response. Do not re-sort items by score or compare scores across requests. A recommendation may target the whole product, a visual choice, or one exact variant. Render one card per product. When `variant_id` is present, use it to preselect the recommended variant or pass it as `variantId` after navigation. virtual.fit does not return several cards for different variants of the same product. Keep your existing merchandising order as the placement fallback when a request fails. An empty successful `complete_the_look` response is valid when the outfit has no compatible open slot or no eligible product is available for that slot. Hide the empty row instead of filling it with unrelated products. ## `track` Send a commerce event. ```javascript theme={null} virtualfit('track', 'product_added_to_cart', { cartId: 'cart-123', quantity: 1, totalAmount: 79, currency: 'USD', productId: 'sku-10042', productHandle: 'linen-midi-dress', productTitle: 'Linen Midi Dress' }); ``` virtual.fit adds the current product context when it is available. Explicit payload fields take precedence. Only call `track` after storefront analytics has initialized. Events sent before analytics is ready are not queued and may be dropped with a console warning. [See the commerce event reference →](/custom-js/commerce-events) ## Object-style alias The loader also exposes `window.VirtualFit`: ```javascript theme={null} window.VirtualFit.setProduct({ id: 'sku-10042', handle: 'linen-midi-dress' }); ``` Available methods are `init`, `setContext`, `setProduct`, `setCustomer`, `setConsentMode`, `recommend`, and `track`. Prefer the queued `virtualfit(...)` form for commands that do not return a value. Call `recommend` after the hosted loader has initialized because it returns a promise with the ranked products. ## SPA integration pattern ```javascript theme={null} router.afterEach((route) => { if (route.type !== 'product') return; virtualfit('setProduct', { id: route.product.id, handle: route.product.handle, title: route.product.title, imageUrl: route.product.featuredImage, variantId: route.selectedVariant?.id || '', variantImageUrl: route.selectedVariant?.featuredImage || '' }); }); ``` Keep one loader and one initialization per page. Update context instead of injecting another script after each route or variant change. # Sync the catalog Source: https://docs.virtual.fit/custom-js/catalog Sync custom storefront products, variants, prices, inventory, media, and size charts. virtual.fit resolves storefront products from your synced catalog. Use the management API for continuous server-to-server sync. Use CSV for scheduled or manual imports. The current contract is schema version 2. Omit `schema_version` for all new integrations. Send `schema_version: 1` only from an existing image-only integration that needs legacy update behavior. Send management API requests to `https://api.virtual.fit`. ## Choose a sync method Push changes as they happen. This is the best option when your backend knows the current variants, prices, or inventory. ```bash theme={null} curl --request PUT \ "https://api.virtual.fit/vfr/manage/sites/$SITE_ID/products/$PRODUCT_ID" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" \ --header "Content-Type: application/json" \ --data @product.json ``` Keep the API key on your server. Never include it in storefront JavaScript. Import a file where each row describes a product-level update or one exact variant. Repeat `product_id` for each additional variant. ```csv theme={null} product_id,title,product_image_url,variants_complete,variant_id,option_values_json,variant_available,inventory_quantity,variant_price,currency dress-10042,Floral Midi Dress,https://cdn.example.com/floral-front.jpg,true,floral-petite-2,"{""color"":""Floral"",""fit"":""Petite"",""size"":""2""}",true,4,79.00,USD ``` Omitted `schema_version` also means version 2 in CSV. ## Find your site ID In virtual.fit, open **Custom JS → Sync Products** and copy the **Storefront Site ID** from the Storefront Credentials section. The site ID is a UUID used in the `site_id` path parameter. It is different from the public site key, your workspace ID, and any ID from your commerce platform. For server-side discovery, call the current-site endpoint with your API key and store the returned `site.id` value for later requests: ```bash theme={null} curl --request GET \ "https://api.virtual.fit/vfr/manage/sites/current" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" ``` ## Start with the smallest useful product You can send the title and image first. Add variants, stock, prices, options, and size charts later under the same product ID. ```json theme={null} { "title": "Floral Midi Dress", "images": [ { "url": "https://cdn.example.com/floral-front.jpg" } ] } ``` For a new product, include: * A stable product ID in the request URL or `product_id` CSV column. * `title`. * At least one public product image. Omitted fields stay unchanged on later updates. This lets a feed publish the essentials quickly and enrich the product progressively. ### Choose a durable product ID `product_id` is the permanent identity of the product inside one site. It is case-sensitive and can be a numeric ID, UUID, or URL-safe string. * Prefer an immutable catalog or database ID. * Keep one ID for the product when prices, images, options, or variants change. * Do not derive it from the title, URL, handle, or current variant combination. * Keep it within 255 UTF-8 bytes and URL-encode it in API paths. A product can begin without variants and gain them later under the same `product_id`. This does not create a second product or require a migration. ## Send products with variants A product holds shared merchandising data. A variant holds one exact purchasable combination, such as `Floral / Petite / 2`. ```json theme={null} { "title": "Floral Midi Dress", "handle": "floral-midi-dress", "canonical_url": "https://shop.example/products/floral-midi-dress", "brand": "Example Fashion", "price": { "amount": "79.00", "currency": "USD" }, "compare_at_price": { "amount": "99.00", "currency": "USD" }, "images": [ { "external_media_id": "floral-front", "url": "https://cdn.example.com/floral-front.jpg", "position": 0 } ], "options": [ { "key": "color", "source_name": "Colour", "kind": "visual", "presentation_role": "include", "position": 0, "values": [ { "source_value": "Floral", "display_label": "Floral", "swatch": { "image_url": "https://cdn.example.com/floral-swatch.jpg" } } ] }, { "key": "fit", "source_name": "Fit", "kind": "fit", "presentation_role": "exclude", "position": 1, "values": [ { "source_value": "Petite", "display_label": "Petite" } ] }, { "key": "size", "source_name": "US Size", "kind": "size", "presentation_role": "exclude", "size_system_code": "us", "size_audience_code": "womens", "size_category_code": "apparel", "position": 2, "values": [ { "source_value": "2", "display_label": "2" } ] } ], "variants_complete": true, "variants": [ { "source_variant_id": "floral-petite-2", "title": "Floral / Petite / 2", "sku": "FLORAL-P-2", "canonical_url": "https://shop.example/products/floral-midi-dress?variant=floral-petite-2", "option_values": { "color": "Floral", "fit": "Petite", "size": "2" }, "available": true, "inventory_quantity": 4, "inventory_observed_at": "2026-07-25T10:00:00Z", "price": { "amount": "79.00", "currency": "USD" }, "compare_at_price": { "amount": "99.00", "currency": "USD" }, "media": [ { "external_media_id": "floral-front" } ] } ], "size_charts": [ { "external_id": "womens-petite", "url": "https://shop.example/pages/womens-petite-size-chart", "applies_to": { "fit": "Petite" }, "size_system_code": "us", "size_audience_code": "womens", "size_category_code": "apparel" } ], "enabled": true } ``` Send only combinations that shoppers can actually select. Option values describe available choices; they do not create a Cartesian product of variants. ## Send stock updates Use the same product upsert endpoint when stock changes. For an existing product, send only the changed variants. You do not need to resend the title, images, prices, or unchanged variants. Identify each variant by the same `source_variant_id` used during the initial sync. ```bash theme={null} curl --request PUT \ "https://api.virtual.fit/vfr/manage/sites/$SITE_ID/products/dress-10042" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "variants": [ { "source_variant_id": "floral-petite-2", "available": false, "inventory_quantity": 0, "inventory_observed_at": "2026-08-01T09:30:00Z" } ] }' ``` Send product-level `available` when your source has no exact variants. A product-level update cannot include an inventory quantity. ```bash theme={null} curl --request PUT \ "https://api.virtual.fit/vfr/manage/sites/$SITE_ID/products/dress-10042" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "available": false }' ``` If the product gains variants later, send stock on each exact variant. Variant availability takes precedence over product-level availability. For exact variants: * Send `available: true` when the variant can be purchased and `false` when it is sold out. * Send `inventory_quantity` when your source provides an exact count. Quantity alone does not set `available`. * Send `inventory_observed_at` as the RFC 3339 time when your source reported the stock. If you omit it, virtual.fit uses the request time. * Keep the timestamp from the source. An older observation does not replace newer stock for the same variant. * Omit `variants_complete` from a targeted stock update. Set it to `true` only when the request contains the complete authoritative variant list. * Refresh stock regularly. virtual.fit treats stale inventory as unknown instead of claiming that a variant is in stock. `enabled` controls whether the product can use the fitting room. It is not a stock field. Keep `enabled` unchanged when only inventory changes. For an existing product, omitting it from an upsert preserves the current state; use the dedicated enable-state endpoint when changing availability by itself. ## Field reference Fields are ordered by how commonly a new integration needs them. **Auto-detected when omitted** means virtual.fit derives the value from the supplied variants, option names, swatches, or media. Stable product ID in the request URL. Keep it unchanged when variants, prices, inventory, or media change. Shopper-facing product name. Required when creating a product. Shared product media. A new product needs at least one public image. See the [image object reference](/reference/schemas/catalog-image). Public HTTP or HTTPS image URL. Stable media ID from your source. Use it to reference this image from variant `media`. Source alt text. Source-defined role. Prefer `front`, `back`, or `side` for those views. `featured`, `primary`, and `gallery` are also accepted. Zero-based display order. Optional source width in pixels. Optional source height in pixels. **Required for most Custom JavaScript storefronts.** Send the stable storefront slug when the site resolves product URLs by handle. You may omit it only when URL resolution uses `product_id`. Public canonical product URL. Must use HTTP or HTTPS. Whether the product is enabled in the fitting room. This is separate from upstream sale availability. Current source-reported sale availability when it is known. Omit or send `null` when unknown. Usually derived from exact variants or synced from the source; variant availability is more precise when variants exist. Current overall customer rating on a 0–5 scale. Omit when the source does not expose an aggregate rating. Number of customer reviews included in the current overall rating. Must be zero or greater. Product-level selling price. A variant price overrides it for that variant. Expand for the exact object shape. Decimal amount as a string, such as `"79.00"`. Three-letter ISO 4217 currency code, such as `USD` or `EUR`. Product-level original or pre-sale price. Uses the same `amount` and `currency` shape as `price`. Exact purchasable combinations. An empty array is valid. Expand for variant identity, selections, inventory, pricing, and media fields, or open the [variant object reference](/reference/schemas/catalog-variant). Stable source ID for this exact combination. Required unless `option_values` uniquely identifies the variant. Shopper-facing variant label, such as `Floral / Petite / 2`. Merchant SKU. Public URL that opens this exact variant. When omitted, recommendations use the product `canonical_url`. Exact option key-to-value selection, for example `{"color":"Floral","fit":"Petite","size":"2"}`. Keys and values must match declared options when `options` is supplied. Whether this exact variant can currently be purchased. Omit or send `null` when unknown. Known inventory quantity. Omit when the source does not expose it. RFC 3339 timestamp for the inventory observation. Unmodified inventory policy from the source system. Stable source inventory-item ID. Variant selling price. Uses `amount` as a decimal string and `currency` as a three-letter ISO 4217 code. Variant original or pre-sale price. Uses the same shape as `variants[].price`. Public primary image for this variant. Variant-specific media. Reference a shared image by `external_media_id`, or provide a public `url`. ID of an item in product `images`. Public HTTP or HTTPS URL when the media is not already in product `images`. Source-defined role such as `primary`, `front`, or `back`. Zero-based display order. When `true`, the supplied variant list is authoritative. Omitted variants become inactive. Send `true` with `variants: []` for a genuinely variantless product. Choice axes, labels, swatches, and size metadata. **Auto-detected when omitted:** virtual.fit derives the minimum option structure from `variants[].option_values`. Send `options` when you have source labels, ordering, swatches, or explicit size metadata. See the [option object reference](/reference/schemas/catalog-option). Stable machine key such as `color`, `fit`, or `size`. Variant `option_values` must use the same key. Merchant label such as `Colour` or `US Size`. **Auto-detected when omitted:** defaults to `key`. **Auto-detected when omitted.** Accepted values: * `visual` — color, pattern, print, wash, or finish. * `style` — another choice that changes the visible garment shape or design. * `size` — numeric, alpha, or shoe size. * `fit` — petite, regular, tall, body type, or fit family. * `length` — length or inseam. * `width` — footwear or garment width. * `other` — a source-specific choice that does not match the above. Accepted values: * `auto` — infer visual identity from the option kind, swatches, and variant media. * `include` — always treat the option as changing the visible product. * `exclude` — never split visual identity on this option. Option display order. Normalized system for a sizing option. Use one of: * Geographic systems: `us`, `eu`, `uk`, `au`, `jp`, `cn`, `kr`. * International letters: `intl_alpha`. * Measurements: `inch`, `cm`, `mondopoint`. * Special cases: `brand_specific`, `one_size`, `unknown`. Who the sizing is designed for. Use `womens`, `mens`, `unisex`, `kids`, `youth`, `baby`, or `unknown`. What kind of sizing the values describe. Use `apparel`, `footwear`, `denim`, `bra`, `hosiery`, `accessories`, or `unknown`. Original source label when it does not map cleanly to a normalized size system. Declared values for this option. Exact value used by variant `option_values`. Shopper-facing label. **Auto-detected when omitted:** defaults to `source_value`. Optional normalized value when the source value is unusual. Value display order. Optional color, multi-color, or image swatch. Image swatches support patterns and textures. Primary CSS color value. Ordered CSS color values for a multi-color swatch. Public HTTP or HTTPS swatch image for a pattern or texture. Optional source CSS value when a color or image is insufficient. Accessible swatch label. Defaults to the option value label. Product-wide or option-scoped size chart references. Stored now for future size-aware recommendations; they do not change today's visual recommendation ranking. See the [size-chart reference](/reference/schemas/catalog-size-chart). Stable chart ID from the source. Public HTTP or HTTPS size chart page or asset. A URL alone is valid and allows a later enrichment step to add structured data. Optional structured chart data when the source already provides it. Option key-to-value selector, for example `{"fit":"Petite"}`. Omit when the chart applies to the whole product. BCP 47 locale such as `en-US` or `de-DE`. Normalized size system. Uses the same accepted values as `options[].size_system_code`. Sizing audience. Uses the same accepted values as `options[].size_audience_code`. Sizing category. Uses the same accepted values as `options[].size_category_code`. Optional measured garment dimensions by size. Use canonical dimension names such as `bust`, `chest`, `waist`, `hips`, `shoulder_width`, `sleeve_length`, `total_length`, `inseam`, `front_rise`, `back_rise`, `thigh`, or `leg_opening`. Use `cm` or `in`. Canonical dimension name. Non-negative measured value. `cm` or `in`. virtual.fit normalizes length internally. Source size this measurement describes, such as `Petite / 4`. Short source label such as `merchant`. Optional confidence from `0` to `1`. Optional product-page model or mannequin fit facts. Send the worn size and any source-reported body measurements. These fields can improve future size recommendations and remain optional. Brand or designer name. Merchant-facing product type. Usually populated automatically when the source exposes it. Optional plain-text product description. Useful enrichment, but not required for fitting-room product matching. Optional product-specific try-on guidance. Optional concise garment naming override used to describe the item during try-on. **Auto-detected when omitted.** Whether the product still exists and is active in the source catalog. Send `false` for archived or removed products. Optional unmodified status from the source system, such as `ACTIVE`, `ARCHIVED`, or `DRAFT`. It is preserved for diagnostics and is not a normalized enum. RFC 3339 timestamp for the source record. Usually populated automatically. Omit for the current contract. The only accepted explicit values are `1` for a legacy image-only request and `2` for the current contract. Optional ordering and idempotency metadata for multi-worker progressive syncs. Use `ingest` only when several workers may update one product or events may arrive out of order. Unique event ID. Reusing it with a different payload is rejected. ID shared by events from one sync run. Positive sequence number within the run. Stable name for the worker or feed. RFC 3339 time when the source was observed. Fields represented by this event. Collections complete in this event. Accepted values are `images`, `options`, `variants`, and `size_charts`. A completed `variants` collection also requires `variants_complete: true`. ## Variant and media behavior * A product may have no variants. Send `variants_complete: true` with `variants: []`. * If variants appear later, keep the same product ID and send the new variant list. * Size-only variants normally share product media. * Color, pattern, material, and style variants can reference distinct media. * Shared media is stored and prepared once even when several variants reference it. * A swatch image represents the selector. Variant media represents the garment used for display and try-on. virtual.fit recommends at most one result per product. A result may identify the best exact variant or the best visual choice within the product. When fresh inventory is known, exact variant results must be available. When availability is unknown, virtual.fit does not claim that a variant is in stock. ## Visual choices You do not create presentation IDs. virtual.fit derives visual choices from option meaning, swatches, and variant media. Use: * `presentation_role: "include"` when an option changes the visible garment. * `presentation_role: "exclude"` for size, fit, length, and other non-visual choices. * `presentation_role: "auto"` when virtual.fit should infer the behavior. If variant media clearly changes with an option such as color, virtual.fit can infer that the option is visual. Explicit roles remain useful when source media is incomplete or ambiguous. ## Size charts Use one chart without `applies_to` when it applies to every variant. Use a selector when petite, regular, tall, or another option value uses a different chart. A chart may contain: * A public `url`. * Extracted structured `content`. * Both a URL and structured content. If you omit size metadata, virtual.fit preserves the source size values but does not guess their geographic system, audience, or category. These three fields are independent: for example, `us` + `womens` + `footwear` is different from `us` + `youth` + `footwear`. Petite, regular, and tall remain option values such as `fit`, and `applies_to` selects the chart for each fit. Reusing the same chart URL or stable `external_id` across products allows virtual.fit to share the stored chart document while keeping each product's `applies_to` selector. ## Optional review evidence You do not need to send reviews. virtual.fit can collect public review evidence when it prepares a product. If your backend already receives complete review records, you can sync them after creating the product. The optional review endpoint accepts each review's stars, full text, purchased variant, customer photos or videos, and source-reported measurements or fit votes. virtual.fit analyzes review text asynchronously, so review enrichment never blocks the product from becoming ready. Use a stable source review ID whenever one exists. Send each review as its complete current record so removing media or structured evidence is unambiguous. See [Sync product reviews](/reference/catalog-reviews). The storefront can request the compact [fit summary](/reference/storefront-fit-evidence) for fast product display and load [full paginated reviews](/reference/storefront-product-reviews) only when the shopper asks to inspect the evidence. ## Partial updates and clearing data For an existing product: * An omitted field stays unchanged. * An explicit `null` clears a supported field or collection. * `variants_complete: true` makes the supplied variant list authoritative. * A plain partial variant update does not remove omitted variants. You may clear `handle`, `preview_image_url`, `brand`, `description`, `product_type`, prices, availability, rating, review count, custom instructions, images, options, variants, size charts, garment measurements, or model observations. ```json theme={null} { "description": null, "size_charts": null, "garment_measurements": null } ``` Clearing `options` removes your supplied labels and swatches. If active variants remain, virtual.fit retains the minimum option structure required to describe them. ### Order updates from multiple workers Add `ingest` metadata when several workers may update one product or when events may arrive out of order. The event and sequence fields make the complete update idempotent and ordered. ```json theme={null} { "variants": [ { "source_variant_id": "floral-petite-2", "available": false, "inventory_quantity": 0, "inventory_observed_at": "2026-07-25T11:00:00Z" } ], "ingest": { "event_id": "inventory-4281", "run_id": "catalog-sync-2026-07-25", "sequence": 12, "producer": "inventory-sync", "observed_at": "2026-07-25T11:00:00Z", "observed_fields": ["variants"] } } ``` ## Delete catalog data Use `DELETE` when the product should be removed from the synced catalog. This permanently removes the synced product record and its managed product images: ```bash theme={null} curl --request DELETE \ "https://api.virtual.fit/vfr/manage/sites/$SITE_ID/products/dress-10042" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" ``` The canonical catalog retains a deletion tombstone so a stale source snapshot cannot serve the product again. Syncing the same product ID later creates it again and clears the tombstone. Use the enable-state endpoint when you only want to hide a product temporarily or preserve its diagnostic history. Deletion removes the synced record and managed images. To keep the product and its images while removing it from the fitting room, set its enabled state: ```bash theme={null} curl --request PUT \ "https://api.virtual.fit/vfr/manage/sites/$SITE_ID/products/dress-10042/enabled" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" \ --header "Content-Type: application/json" \ --data '{"enabled":false}' ``` Send `{"enabled":true}` to re-enable it. Disabled products remain in the product count, but do not consume enabled-product slots. Delete one variant: ```bash theme={null} curl --request DELETE \ "https://api.virtual.fit/vfr/manage/sites/$SITE_ID/products/dress-10042/variants/floral-petite-2" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" ``` The variant path accepts the stable source variant ID used during sync. ## CSV format Each CSV upload is a synchronous import of at most 1,000 rows. Split larger catalogs into multiple files. Product and variant upserts are idempotent, so it is safe to retry a file; if an infrastructure failure occurs after processing starts, rows already saved remain saved. Omit `schema_version`; version 2 is the default. Repeat the product ID on each variant row. Blank product-level cells on later rows inherit the first row for that product. ```csv theme={null} product_id,title,handle,canonical_url,product_image_url,rating,review_count,options_json,variants_complete,variant_id,variant_canonical_url,option_values_json,variant_image_url,variant_available,inventory_quantity,inventory_observed_at,variant_price,variant_compare_at_price,currency,size_chart_url dress-10042,Floral Midi Dress,floral-midi-dress,https://shop.example/products/floral-midi-dress,https://cdn.example.com/floral-front.jpg,4.7,128,"[{""key"":""color"",""source_name"":""Colour"",""kind"":""visual"",""presentation_role"":""include"",""values"":[{""source_value"":""Floral"",""display_label"":""Floral"",""swatch"":{""image_url"":""https://cdn.example.com/floral-swatch.jpg""}}]}]",true,floral-petite-2,https://shop.example/products/floral-midi-dress?variant=floral-petite-2,"{""color"":""Floral"",""fit"":""Petite"",""size"":""2""}",https://cdn.example.com/floral-front.jpg,true,4,2026-07-25T10:00:00Z,79.00,99.00,USD,https://shop.example/pages/size-chart ``` Include `operation`. * `operation=delete` with an empty `variant_id` deletes the product. * `operation=delete` with `product_id` and `variant_id` deletes that variant. ```csv theme={null} operation,product_id,variant_id,title,product_image_url delete,dress-10042,floral-petite-2,, ``` Existing image-only importers can set `schema_version` to `1`. Version 1 supports product identity, titles, handles, enabled state, preview images, prompt fields, and product image URLs. ```csv theme={null} schema_version,product_id,title,handle,product_image_url,enabled 1,dress-10042,Floral Midi Dress,floral-midi-dress,https://cdn.example.com/floral-front.jpg,true ``` Version 1 does not accept variants, options, prices, inventory, size charts, or delete rows. If those fields are present, the import explains which fields require the current contract. ## Legacy JSON compatibility Use an explicit legacy version only while an existing image-only integration is being migrated: ```json theme={null} { "schema_version": 1, "title": "Floral Midi Dress", "handle": "floral-midi-dress", "product_image_url": "https://cdn.example.com/floral-front.jpg", "enabled": true } ``` Do not add current fields to a version 1 request. If virtual.fit detects fields such as `options`, `variants`, prices, inventory, or size charts, it returns a message that lists the incompatible fields and tells you to omit `schema_version`. ## Image requirements Image URLs must be reachable without shopper cookies, expiring browser sessions, or IP-bound authorization. Use stable HTTPS CDN URLs and clear, high-resolution JPEG, PNG, or WebP images up to 64 MB. Avoid short-lived signed URLs unless they remain available during preparation and later refreshes. Prefer images that show the complete sold product on a model or mannequin. When available, send front, back, and side views. These views provide a more useful fit reference than a flat lay or isolated ghost image and generally produce more accurate try-on results. Flat-lay, ghost, and product-only images are still accepted. virtual.fit automatically analyzes, deduplicates, and selects the strongest prepared views without modifying the originals. When a photo contains several garments, also include a view where the sold item is unambiguous. ## Input limits Limits are intentionally generous enough for large catalogs while preventing a single malformed request from consuming unbounded memory or database space. Limits apply equally to JSON and CSV values. | Input | Limit | | ----------------------------------------------- | -------------------------------------------- | | JSON product body | 4 MiB | | CSV file | 32 MiB and 1,000 rows per synchronous import | | Product IDs, handles, variant IDs, SKUs, labels | 255 UTF-8 bytes each | | Product title | 500 UTF-8 bytes | | Description | 64 KiB | | Custom instructions | 4 KiB | | URL | 8 KiB | | Images per product | 500 | | Options per product | 20 | | Values per option | 1,000 | | Variants per product | 5,000 | | Media references per variant | 100 | | Size-chart references per product | 50 | | Structured size-chart content | 256 KiB each | | Garment measurements per product | 250 | | Model observations per product | 50 | A request that exceeds a byte or collection limit returns `413` with the field that must be reduced. Invalid values within the limits return `400`. ## Common sync failures | Failure | Fix | | ------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | Missing values on a new product | Include a title and at least one product image. | | A version 1 request contains current fields | Remove `schema_version` to use the current contract, or remove the listed unsupported fields. | | Image preparation never completes | Confirm the URL is public, stable, no larger than 64 MB, and returns an image content type. | | A variant is rejected | Declare matching option keys and values, or send the variant without conflicting option definitions. | | A variant disappears unexpectedly | Use `variants_complete: true` only when the supplied list is authoritative. | | URL matching finds no product | Keep the product ID and handle aligned with your configured URL resolution. | Never call the management API from browser JavaScript. Its API key can modify catalog data and must remain server-side. # Commerce events Source: https://docs.virtual.fit/custom-js/commerce-events Track cart, checkout, and purchase outcomes for Custom JavaScript storefront analytics. Custom storefronts must send commerce events so virtual.fit can connect fitting-room usage to cart and purchase outcomes. Try-on views, opens, uploads, starts, completions, and failures are recorded automatically. ## Event reference | Event | Send when | Product fields | Amount | | ---------------------------- | --------------------------------------- | --------------------------------- | --------------------------------- | | `product_added_to_cart` | A product is successfully added to cart | Required | Line total for the added quantity | | `checkout_started_line_item` | Checkout starts | One event per line item | Line total | | `checkout_completed` | The order or checkout completes | Not required | Full order total | | `purchase_line_item` | The order completes | One event per purchased line item | Line total | Do not send one aggregate product event for a multi-item checkout. Send one line-item event per product, then one checkout-level completion event. ## Set shopper identity Attach customer context before sending commerce events: ```javascript theme={null} virtualfit('setCustomer', { id: currentCustomer?.id || '', email: currentCustomer?.email || '' }); ``` For logged-out shoppers, omit the fields or pass empty strings. virtual.fit maintains anonymous journey context according to the active consent mode. ## Add to cart Send after your cart API confirms success, not when the shopper merely clicks the button. ```javascript theme={null} virtualfit('track', 'product_added_to_cart', { cartId: 'cart-123', quantity: 2, totalAmount: 158, currency: 'USD', productId: 'sku-10042', productHandle: 'linen-midi-dress', productTitle: 'Linen Midi Dress' }); ``` Before adding manual tracking, check whether a successful add-to-cart already appears in virtual.fit. Do not send a duplicate event. ## Checkout started Send one event for each checkout line item. ```javascript theme={null} checkout.lineItems.forEach((lineItem) => { virtualfit('track', 'checkout_started_line_item', { cartId: checkout.cartId, checkoutId: checkout.id, quantity: lineItem.quantity, totalAmount: lineItem.lineTotal, currency: checkout.currency, productId: lineItem.productId, productHandle: lineItem.productHandle, productTitle: lineItem.productTitle }); }); ``` ## Purchase completed Send one checkout-level completion, followed by one event per purchased line item. ```javascript theme={null} virtualfit('track', 'checkout_completed', { cartId: order.cartId, checkoutId: order.checkoutId, orderId: order.id, currency: order.currency, totalAmount: order.total }); order.lineItems.forEach((lineItem) => { virtualfit('track', 'purchase_line_item', { cartId: order.cartId, checkoutId: order.checkoutId, orderId: order.id, quantity: lineItem.quantity, totalAmount: lineItem.lineTotal, currency: order.currency, productId: lineItem.productId, productHandle: lineItem.productHandle, productTitle: lineItem.productTitle }); }); ``` ## Payload fields | Field | Type | Description | | --------------- | -------- | -------------------------------------------------------------- | | `cartId` | `string` | Stable cart identifier shared across cart and checkout events. | | `checkoutId` | `string` | Stable checkout identifier. | | `orderId` | `string` | Completed order identifier. | | `quantity` | `number` | Quantity represented by this line-item event. | | `totalAmount` | `number` | Numeric line or order total, without a currency symbol. | | `currency` | `string` | Uppercase ISO 4217 code such as `USD` or `EUR`. | | `productId` | `string` | Same external product ID synced to virtual.fit. | | `productHandle` | `string` | Same handle synced to virtual.fit. | | `productTitle` | `string` | Display title at the time of the event. | ## Correctness rules * Send events only after the business action succeeds. * Use stable IDs across the whole journey. * Use line totals for line-item events and order totals for `checkout_completed`. * Keep amounts in the stated currency; do not send formatted strings. * Avoid duplicate events from click handlers, cart callbacks, and tag managers. * Call `setCustomer` after identity changes. * Respect analytics consent before including identity. ## Verify events 1. Use a unique test product and cart. 2. Complete one try-on. 3. Add the product to cart. 4. Start checkout. 5. Complete a test order if your environment supports it. 6. Open **Virtual Fitting Room → Analytics** and confirm each funnel stage increments once. If a stage is missing, verify that the event is sent only after the corresponding cart, checkout, or order action succeeds and that its product ID matches the synced catalog record. # Loader configuration Source: https://docs.virtual.fit/custom-js/configuration Configure placement, product context, customer access, terms, and data attributes. Initialize virtual.fit before loading the hosted script. The queue preserves commands until the loader is ready. ## Complete example ```html theme={null} ``` ## Initialization fields | Field | Type | Default | Description | | ----------------------- | ------------------------- | ----------------- | ------------------------------------------------------------------------------------------------------- | | `siteKey` | `string` | Required | Public key shown in virtual.fit. | | `mount` | CSS selector or `Element` | Automatic | Main product media host. Set this explicitly when automatic placement does not select the full gallery. | | `overlayPosition` | `string` | `top-right` | `top-right`, `top-left`, `bottom-right`, or `bottom-left`. | | `product` | `object` | URL-resolved | Optional explicit product context. | | `customer` | `object` | Anonymous | Current customer `id` and optional `email`. | | `auth` | `object` | Anonymous visible | Login visibility and destination. | | `labels` | `object` | English defaults | Shopper-facing labels and messages. | | `terms` | `object` | Default terms | Summary, full terms, and email controls. | | `language` | `string` | `en` | Language identifier for terms configuration. | | `overlayTargetSelector` | `string` | Automatic | Advanced gallery host override. | | `overlayImageSelector` | `string` | `img` | Image inside the overlay target. | | `gallerySelector` | `string` | Empty | Advanced result-gallery selector. | | `thumbnailSelector` | `string` | Empty | Advanced thumbnail selector. | Start with `siteKey`, `mount`, and terms. Add advanced selectors only after the basic integration works. ## Product object ```javascript theme={null} { id: 'dress-10042', handle: 'linen-midi-dress', title: 'Linen Midi Dress', imageUrl: 'https://cdn.example.com/linen-midi-dress.jpg', variantId: 'linen-black-petite-2', variantImageUrl: 'https://cdn.example.com/linen-black.jpg' } ``` Provide `id` or `handle`. The loader verifies it against the synced enabled catalog before mounting. Stable product ID from catalog sync. Keep this ID unchanged when the shopper selects another variant. Synced product handle. Provide `id` or `handle`. Current shopper-facing title. Product display fallback. It does not replace canonical prepared media. Optional exact `source_variant_id` synced under the product. Optional selected-variant display hint. Canonical synced variant media remains authoritative for try-on. Call `setProduct` when a dynamic storefront changes the product or selected variant. See the [Browser API](/custom-js/browser-api#setproduct). ## Customer and authentication ```javascript theme={null} auth: { showToAnonymous: true, loginUrl: ({ returnTo, product, location }) => '/login?return_to=' + encodeURIComponent(returnTo) }, customer: { id: 'customer-8421', email: 'shopper@example.com' } ``` `auth.loginUrl` accepts a string or callback. The callback receives: * `returnTo` — Current absolute page URL. * `product` — Resolved product context, or `null`. * `location` — Current `href`, origin, pathname, search, and hash. `showToAnonymous` controls whether a logged-out shopper can see a login call to action when your virtual.fit settings require authentication. The customer-access policy in virtual.fit remains authoritative. ## Terms object ```javascript theme={null} terms: { summaryHtml: 'AI preview only. Actual fit may differ.', fullSelector: '#virtual-fit-terms', collectEmail: false, requireEmail: false, emailNote: 'We will send this try-on result to the address you provide.' } ``` Use one source for full terms: * `fullHtml` — Pass full HTML directly. * `fullSelector` — Read `innerHTML` from an existing host-page element. If neither is set, virtual.fit uses its default terms. See [Styling, labels, and terms](/custom-js/styling-and-copy). ## Single-tag installation When a platform allows one script tag but no inline queue, use data attributes: ```html theme={null} ``` JavaScript initialization is preferred when values are dynamic, variant selection changes after page load, or `loginUrl` needs callback logic. ## Legacy aliases Use `terms` for disclaimer and legal content. Use `labels` for interface text. Older `content` and `ui` aliases remain accepted for existing installs, but new integrations should not depend on them. # Resolve product URLs Source: https://docs.virtual.fit/custom-js/product-resolution Map custom storefront URLs to enabled virtual.fit catalog products. Before rendering, virtual.fit matches the current page to a synced product. Configure one deterministic rule and test it with real storefront URLs. ## Resolution modes | Mode | Example URL | Configuration | Extracted value | | ----------------- | --------------------------------- | ------------------------------------ | ------------------- | | Path template | `/products/linen-dress` | `/products/:handle` | `linen-dress` | | Last path segment | `/collections/summer/linen-dress` | Match by handle | `linen-dress` | | Query parameter | `/product?sku=sku-10042` | Parameter `sku`, match by product ID | `sku-10042` | | Custom regex | `/shop/item/linen-dress` | `^/shop/item/([^/]+)$` | First capture group | ### Path template Use a path template when product routes have a consistent structure. ```text theme={null} /products/:handle /shop/:handle /p/:product_id ``` The token must match **Match Products By**. Use `:handle` when matching handles and `:product_id` when matching external product IDs. ### Last path segment Use this only when the final path segment is always the product handle or ID. ```text theme={null} /women/dresses/linen-midi-dress └─ linen-midi-dress ``` Avoid it if locale, variant, or campaign segments can appear after the product value. ### Query parameter Use this for routes that expose a stable product identifier in the query string. ```text theme={null} /product?sku=sku-10042 ``` Set **Query Parameter Name** to `sku` and match by **Product ID**. ### Custom regex Use a custom regular expression only when the standard modes cannot represent the route. The first capture group becomes the product hint. ```regex theme={null} ^/shop/item/([^/]+)$ ``` Keep the expression anchored and narrow. A broad regex can accidentally match category, search, or account pages. ## Test the rule In virtual.fit's **Live URL Tester**: 1. Paste an absolute URL from the real storefront. 2. Confirm the extracted value. 3. Confirm the matched product title and ID. 4. Confirm the message says the product is enabled. Test at least: * A valid enabled product. * A valid disabled product. * An unknown product. * A collection or search page. * A localized route, if your storefront uses locales. ## Manual product context For SPAs, query-driven PDPs, or routes that cannot be expressed by a rule, call `setProduct` after initialization: ```javascript theme={null} window.virtualfit?.('setProduct', { id: product.id, handle: product.handle, title: product.title, imageUrl: product.featuredImage, variantId: product.selectedVariant?.id || '', variantImageUrl: product.selectedVariant?.featuredImage || '' }); ``` The `id` or `handle` must still identify a synced, enabled product. Manual context does not bypass its availability settings in virtual.fit. Call `setProduct` again after your router commits each new product page and whenever the selected variant changes. ### Color and style variants Keep one synced product ID for the product. Sync exact variants under it, including variant media when color, pattern, material, or style changes the garment. ```javascript theme={null} virtualfit('setProduct', { id: product.id, handle: product.handle, title: product.title, imageUrl: product.featuredImage, variantId: selectedVariant.id, variantImageUrl: selectedVariant.featuredImage }); ``` `variantId` must match a `source_variant_id` synced under the product. `variantImageUrl` is a display hint; virtual.fit uses the canonical prepared media linked to the variant. Size-only variants usually share the product's media. You can still send their `variantId` so availability and inventory refer to the exact purchasable combination. Do not create duplicate product records for each color or size. One product with exact variants keeps recommendations product-level while still allowing virtual.fit to select the best in-stock visual variant. ## Fail-closed behavior The widget stays hidden when: * The rule extracts no value. * The value does not match a synced product. * The matched product is disabled. * The matched product has no usable garment images. This is expected behavior. Do not add a fallback product unless every unmatched page should deliberately use that product. # Custom JavaScript quickstart Source: https://docs.virtual.fit/custom-js/quickstart Install the hosted virtual.fit loader on a custom or headless storefront. The Custom JavaScript integration adds virtual.fit to any storefront that can load a hosted script. Your virtual.fit settings control product availability, shopper access, and daily limits. ## Prerequisites Before installing the loader, you need: * A custom storefront site in virtual.fit. * Its public site key and hosted loader URL. * An exact production or staging origin. * One synced, enabled product with usable garment images. * A CSS selector for the main product media wrapper. The site key is public and belongs in browser code. Management API keys are secret and must never be embedded in the storefront. ## 1. Allow the storefront origin In virtual.fit, open **Custom JS → Installation**. Add each origin that will load the widget or send analytics. ```text theme={null} https://shop.example.com https://staging-shop.example.com ``` An origin is the scheme, hostname, and optional port. Do not include paths, query strings, or trailing product URLs. | Page URL | Allowed origin | | ----------------------------------------------- | ---------------------------------- | | `https://shop.example.com/products/linen-dress` | `https://shop.example.com` | | `https://staging.example.com:8443/p/sku-42` | `https://staging.example.com:8443` | ## 2. Sync and enable one product Use a CSV import or the management API to add a product. Its `handle` or `product_id` must match the value your product URL exposes. For `/products/linen-midi-dress`, a typical management API request uses the stable product ID in the URL: ```bash theme={null} curl --request PUT \ "https://api.virtual.fit/vfr/manage/sites/$SITE_ID/products/sku-10042" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "handle": "linen-midi-dress", "title": "Linen Midi Dress", "images": [ {"url": "https://cdn.example.com/linen-midi-dress-front.jpg", "role": "front"}, {"url": "https://cdn.example.com/linen-midi-dress-back.jpg", "role": "back"} ], "enabled": true }' ``` Prefer full-product front, back, and side views on a model or mannequin when available. virtual.fit analyzes the images and chooses the strongest prepared views automatically. See [Sync the catalog](/custom-js/catalog) for CSV and API details. ## 3. Configure product URL detection For a URL such as `https://shop.example.com/products/linen-midi-dress`: * Set **Resolution Mode** to **Path template**. * Set **Match Products By** to **Handle**. * Set **Path Template** to `/products/:handle`. Paste a real product URL into the virtual.fit live URL tester. Continue only when it reports an enabled matched product. ## 4. Install the loader Copy the generated snippet from virtual.fit. The basic pattern is: ```html theme={null} ``` Place the snippet on product pages, usually before ``. Use the exact site key shown in virtual.fit. ### Choose the mount target Point `mount` at the main product gallery or media wrapper. Good targets: ```text theme={null} .product-media .product-gallery [data-product-gallery] ``` Avoid the buy box, product form, add-to-cart button, cart drawer, recommendations, and elements that disappear on variant change. ## 5. Provide full terms markup If you use `fullSelector`, add a hidden element whose `innerHTML` the widget can display: ```html theme={null} ``` You can instead provide `terms.fullHtml` directly. See [Styling, labels, and terms](/custom-js/styling-and-copy). ## 6. Verify the integration Open the real product URL and confirm: * The **Try On** control appears once. * A disabled or unknown product does not show the control. * The widget is positioned over the main product media. * A photo can be uploaded and a try-on completes. * The generated image appears under **Results** in virtual.fit. Your first integration is complete when one enabled product passes the full [launch checklist](/getting-started/launch-checklist). ## Next steps Add authentication, product context, terms, and advanced selectors. Connect add-to-cart, checkout, and purchase outcomes to try-on usage. # Styling, labels, and terms Source: https://docs.virtual.fit/custom-js/styling-and-copy Match virtual.fit to your storefront and configure shopper-facing text and terms. The widget inherits storefront button styles where possible. Use initialization fields for placement and copy, then CSS variables for deliberate visual overrides. ## Position the overlay ```javascript theme={null} virtualfit('init', { siteKey: 'site_pub_your_key', mount: '.product-media', overlayPosition: 'bottom-right' }); ``` Supported values are `top-right`, `top-left`, `bottom-right`, and `bottom-left`. Fine-tune spacing on the mounted container: ```css theme={null} .virtualfit-tryon-container { --virtualfit-overlay-offset-x: 20px !important; --virtualfit-overlay-offset-y: 20px !important; --virtualfit-overlay-z-index: 50; } ``` ## Style the button ```css theme={null} .virtualfit-tryon-container { --virtualfit-font-family: "Inter", Arial, sans-serif !important; --virtualfit-button-bg: #111111 !important; --virtualfit-button-text: #ffffff !important; --virtualfit-button-border: 1px solid #111111 !important; --virtualfit-button-radius: 0 !important; --virtualfit-button-padding-y: 12px !important; --virtualfit-button-padding-x: 18px !important; --virtualfit-button-font-size: 14px !important; --virtualfit-button-font-weight: 600 !important; --virtualfit-button-line-height: 1.2 !important; --virtualfit-button-text-transform: uppercase !important; --virtualfit-button-letter-spacing: 0.04em !important; --virtualfit-button-shadow: none !important; --virtualfit-button-hover-bg: #333333 !important; --virtualfit-button-hover-text: #ffffff !important; } ``` Test hover, focus, disabled, loading, and mobile states. Preserve visible focus indicators and sufficient color contrast. ## Configure labels Pass translated interface copy through `labels`: ```javascript theme={null} virtualfit('init', { siteKey: 'site_pub_your_key', mount: '.product-media', labels: { triggerButton: 'Try it on', uploadHint: 'Use a clear full-body photo in fitted clothing', generateButton: 'Generate try-on', processing: 'Processing', loginRequired: 'Sign in to use virtual try-on', loginAction: 'Sign in', successTitle: 'Try-on complete', successMessageGallery: 'Your result is available in the product media.' } }); ``` ### Common label keys | Area | Keys | | ----------------- | ------------------------------------------------------------------------------------------ | | Primary actions | `triggerButton`, `generateButton`, `close`, `tryAgain` | | Upload | `uploadHint`, `addPhoto`, `selectPhoto`, `removePhoto`, `invalidFileType`, `maxFileSize` | | Processing | `processing`, `preparingTryOn`, `processingTryOn`, `uploadingPhoto`, `generating` | | Authentication | `loginRequired`, `loginRequiredError`, `loginUploadRequired`, `loginAction` | | Limits and safety | `dailyLimitReached`, `maxPhotos`, `maxConcurrentTryOns`, `imageRejected`, `safetyFiltered` | | Results | `tryOnResult`, `viewTryOnResult`, `downloadImage`, `successTitle`, `successMessageGallery` | | Terms | `termsTitle`, `termsShowMore`, `termsShowLess`, `termsAccept` | | Email | `emailLabel`, `emailOptional`, `emailPlaceholder`, `emailRequired`, `emailInvalid` | Some messages accept placeholders: * `maxFileSize`: `{maxSizeMB}` * `maxPhotos`: `{maxPhotos}` * `maxConcurrentTryOns`: `{maxConcurrent}` * `showAlternateImage`: `{label}` The loader does not provide an automatic translation registry for custom sites. Pass the appropriate labels when the storefront language changes. ## Configure terms Keep legal and disclaimer content in `terms`, not `labels`. ### Inline HTML ```javascript theme={null} virtualfit('init', { siteKey: 'site_pub_your_key', mount: '.product-media', terms: { summaryHtml: 'This AI preview is illustrative. Actual fit may differ.', fullHtml: '

Full merchant virtual try-on terms...

' } }); ``` ### Host-page selector ```html theme={null} ``` ```javascript theme={null} virtualfit('init', { siteKey: 'site_pub_your_key', mount: '.product-media', terms: { summaryHtml: 'This AI preview is illustrative. Actual fit may differ.', fullSelector: '#virtual-fit-terms' } }); ``` Use `fullSelector` when the storefront already owns the legal HTML. The element may stay hidden; the widget reads its `innerHTML`. Sanitize any merchant-managed HTML before placing it in the page or passing it to `fullHtml`. The browser renders this content in the shopper interface. ## Copy principles * Describe the output as an AI visualization, not a sizing guarantee. * State that actual fit, color, and proportions may differ. * Tell shoppers what photo works best. * Explain age, image-rights, retention, and prohibited-use requirements. * Keep error messages actionable. * Review translated legal text independently from interface labels. See [Privacy and consent](/operations/privacy-and-consent) for data-handling guidance. # Troubleshoot Custom JavaScript Source: https://docs.virtual.fit/custom-js/troubleshooting Resolve origin, catalog, product matching, mount, SPA, styling, and analytics issues. Check the storefront in this order: allowed origin → product match → product availability → mount selector → shopper flow → commerce events. ## The widget does not appear | Check | Expected state | | -------------- | --------------------------------------------------------------- | | Allowed origin | The exact `window.location.origin` is saved in virtual.fit. | | Installation | The generated script URL loads successfully. | | Site key | `siteKey` belongs to the same custom storefront. | | URL rule | The live tester matches the page to the expected product. | | Product | The product is enabled and has a usable garment image. | | Mount | `document.querySelector(mount)` returns the main media wrapper. | Check the two page-specific values in the browser console: ```javascript theme={null} window.location.origin document.querySelector('.product-media') ``` The first must exactly match an allowed origin. Replace the example selector with your configured `mount`; it must return an element on every supported product template. ## The browser reports 401 or 403 * Save the exact scheme, host, and port under **Allowed Origins**. * Do not include a path such as `/products`. * Check whether the page redirects between `www` and non-`www` hostnames. * Add staging and production as separate origins. * Confirm your content security policy permits the script and service URLs shown in virtual.fit. ## The URL tester extracts the wrong value * Prefer a path template over last-segment matching. * Match by `handle` only when the URL contains the synced handle. * Match by `product_id` only when the URL contains that external ID. * Put the desired value in the first capture group of a custom regex. * Account for locale segments such as `/en/` or `/et/`. See [Resolve product URLs](/custom-js/product-resolution). ## The mount target is missing * Mount to the full product gallery wrapper, not one image. * Use a selector present on every product template. * Avoid generated class names that change on deploy. * For an SPA, call `init` once, then update the product after the route and gallery have rendered. ## The widget appears more than once * Include the hosted script once. * Call `init` once per page lifecycle. * Remove duplicate tag-manager or theme-manager installations. * Use `setProduct` or `setContext` after application state changes. ## SPA navigation shows the previous product Call `setProduct` after each product route is ready: ```javascript theme={null} virtualfit('setProduct', { id: nextProduct.virtualFitProductId, title: nextProduct.title, imageUrl: nextProduct.featuredImage }); ``` For color or style variants, pass the selected variant's unique synced ID. Changing only `imageUrl` does not change the prepared garment used for try-on. ## Product images do not prepare * Open each image URL in a private browser window. * Confirm it loads without cookies or a temporary signed session. * Replace expired or short-lived image URLs. * Use clear garment media instead of charts, collages, or unrelated assets. * Prepare the product again after updating its images. ## Styling does not apply * Apply the documented variables to `.virtualfit-tryon-container`. * Load overrides after your storefront theme styles. * Check whether the theme applies a more specific font, button, or color rule. * Re-test hover, focus, disabled, and mobile states. ## Commerce events are missing * Send events only after the cart, checkout, or order action succeeds. * Set customer context after login and logout when consent permits. * Use the same product IDs and handles synced to virtual.fit. * Send one checkout and purchase line-item event per item. * Avoid sending the same event from both a callback and a tag manager. Follow the [Commerce events verification flow](/custom-js/commerce-events#verify-events). ## Contact support Include: * Site ID and only the public site key prefix. Never send a secret API key. * Affected page URL and exact origin. * Synced product ID and handle. * URL resolution mode and mount selector. * Browser and device. * Visible browser errors and failed requests. * Approximate test time and timezone. Contact [virtual.fit support](https://virtual.fit/support) with this information. # How virtual.fit works Source: https://docs.virtual.fit/getting-started/how-it-works Understand product readiness, the shopper journey, and the information each integration supplies. Your virtual.fit dashboard controls product availability and shopper access. The storefront integration presents the fitting room on eligible product pages. ## How the integration works Shopify provides the installed store context automatically. Custom JavaScript sites use a public `siteKey` and an exact allowed origin. Shopify supplies its product ID and handle. Custom sites resolve a synced product from the page URL or an explicit `setProduct` call. The product must be available for try-on and have a usable garment image. Otherwise, the fitting room stays hidden. virtual.fit anchors the **Try On** control to the main product media and keeps the shopper on the merchant storefront. The shopper uploads a photo, starts a try-on, and receives a generated result. Usage and commerce activity appear in virtual.fit analytics. ## What each side provides | Area | virtual.fit controls | Your storefront supplies | | ------------ | ---------------------------------------------------- | ---------------------------------------------------- | | Access | Available products, customer access, daily limits | Customer identity and login return URL | | Product data | Catalog records, usable images, product instructions | Current product ID, handle, title, and image | | Experience | Product readiness and shopper policy | Placement, labels, terms, and appearance | | Measurement | Analytics and result reporting | Cart, checkout, and purchase events for custom sites | Storefront presentation settings cannot make an unavailable product eligible. Product state and customer access are managed in virtual.fit. ## Product gating The fitting room renders only when all required state is present: * The storefront is connected and authorized. * The current page resolves to a known product. * That product is available for try-on. * Product preparation found at least one usable garment image. * The configured mount target exists on the page. This fail-closed behavior prevents a broken or incomplete fitting room from appearing on unrelated pages. ## Shopper identity Shopify supplies signed-in customer context through the app integration. Custom sites can call `setCustomer` after login and on identity changes. Anonymous shoppers receive a storefront-scoped identity unless your access policy requires login. Use `setConsentMode('cookieless')` when analytics must omit shopper identity. See [Privacy and consent](/operations/privacy-and-consent). Custom JavaScript developers can find the stable integration commands in the [Browser API reference](/custom-js/browser-api). # Launch checklist Source: https://docs.virtual.fit/getting-started/launch-checklist Verify product eligibility, shopper behavior, analytics, accessibility, and rollback before launch. Run this checklist in the same theme and domain you plan to expose to shoppers. ## Storefront * [ ] The **Try On** control appears exactly once on an Active or available product. * [ ] The control is anchored to the main product gallery on desktop and mobile. * [ ] A disabled product does not show virtual.fit. * [ ] A non-product page does not show virtual.fit. * [ ] Variant changes and client-side navigation do not create duplicate controls. * [ ] The fitting room remains usable at 200% browser zoom and on a narrow mobile viewport. * [ ] Keyboard users can open, operate, and close the interface. ## Product quality * [ ] At least one product has finished preparation. * [ ] The selected product images show the garment clearly. * [ ] Front, back, and alternate angles are classified correctly where available. * [ ] Low-quality, duplicate, or unrelated images are disabled. * [ ] Product IDs and handles match the live storefront values. ## Shopper journey * [ ] A signed-out shopper sees the expected experience for your customer access policy. * [ ] Login returns the shopper to the same product page when login is required. * [ ] A supported photo uploads successfully. * [ ] Terms and consent copy are correct for the storefront language. * [ ] One complete try-on returns a result on the product page. * [ ] The result appears in **Virtual Fitting Room → Results**. ## Analytics * [ ] Product view, fitting-room open, try-on start, and try-on completion appear in **Analytics**. * [ ] Add-to-cart is recorded once. * [ ] Checkout and purchase data are recorded with the expected currency and totals. * [ ] Multi-item orders produce one line-item event per item on custom integrations. * [ ] Cookieless mode omits customer identity when consent is not available. ## Operations * [ ] Your support team knows how to disable a product. * [ ] You have a tested rollback: disable the Shopify app embed or remove the custom loader. * [ ] A theme change or storefront deploy includes a virtual.fit smoke test. * [ ] Your privacy notice and merchant terms cover the deployed experience. Launch when one product completes the full product page → try-on → cart → analytics → results path without visible errors. # virtual.fit documentation Source: https://docs.virtual.fit/index Add the virtual.fit fitting room to Shopify or any custom storefront. virtual.fit adds an AI fitting room to product pages. Shoppers upload a photo, preview a garment, build confidence in their choice, and continue shopping without leaving your storefront. Connect your store, enable the theme app embed, prepare products, and launch. Add the hosted loader to any storefront and control product, customer, and commerce context. ## Choose an integration Use the Shopify app when your catalog and storefront run on Shopify. Product sync, theme delivery, customer context, and commerce analytics are integrated for you. [Start the Shopify installation →](/shopify/install) Use the hosted JavaScript loader for headless commerce, custom platforms, and non-Shopify stores. You control catalog sync, URL matching, customer identity, and commerce events. [Start the JavaScript installation →](/custom-js/quickstart) ## What you configure Install the Shopify app or register your custom storefront's allowed origins. Prepare eligible apparel, choose which products are Active, and review the garment images used for try-on. Enable the Shopify app embed or mount the JavaScript widget to the main product gallery. Run a real try-on, add the item to cart, and confirm data appears in **Analytics** and **Results**. ## Next steps Understand product readiness, the shopper journey, and data flow. Verify behavior before exposing virtual.fit to shoppers. Configure shopper notices and analytics consent. # Analytics and results Source: https://docs.virtual.fit/operations/analytics-and-results Read the virtual.fit funnel, compare products, and review generated results. Use **Analytics** to understand how shoppers move from product discovery to purchase. Use **Results** to confirm output quality and investigate individual product experiences. ## Read the funnel | Metric | What it tells you | | --------------------- | ----------------------------------------------------------- | | **Product Views** | Eligible product-page views observed by virtual.fit. | | **Widget Opens** | Times shoppers opened the fitting room. | | **Try-ons Completed** | Try-ons that produced a result. | | **Add To Cart** | Successful cart additions recorded for tracked products. | | **Checkout Started** | Tracked products that entered checkout. | | **Purchases** | Completed purchases attributed to tracked product activity. | | **Revenue** | Revenue reported with completed purchase activity. | Choose **Today**, **Last 7 days**, **Last 30 days**, or **All time**, then select **Refresh** when you need the latest activity. Recent storefront activity can take a short time to appear. Currency and revenue quality depend on complete commerce event data. ## Compare products The **Top Products** table brings views, completed try-ons, cart additions, purchases, and revenue together by product. Use it to answer practical questions: * Which products attract try-ons but few cart additions? * Which Active products receive views but no fitting-room opens? * Which products convert after a completed try-on? * Do recent image or theme changes affect one product more than others? Compare similar products over the same date range. A low-volume product can show large percentage swings from only a few shoppers. ## Review generated results Open **Results** to review completed try-ons for the selected storefront. * Check that the product title matches the garment shown. * Review representative results across garment types and source-photo styles. * Confirm recent product-image changes improved the expected products. * Use timestamps to match a shopper report to the correct result. A deleted result remains listed as unavailable so historical counts stay understandable. The image itself can no longer be reviewed. Results contain shopper-provided personal data. Limit dashboard access, avoid unnecessary exports, and do not reuse images for marketing, portfolios, or model training without separate valid consent. ## When numbers look incomplete 1. Use a single test product and note the start time. 2. Open virtual.fit and complete one try-on. 3. Add that product to cart. 4. Start checkout and, where possible, complete a test order. 5. Refresh **Analytics** after allowing time for processing. For Custom JavaScript storefronts, verify the event timing and identifiers in [Commerce events](/custom-js/commerce-events). For Shopify, confirm the app remains installed and connected. ## Report an analytics issue Include: * Storefront name and affected product ID. * Date range and timezone. * Expected and observed funnel stages. * Order, checkout, or cart ID when relevant. * Approximate test time. * Whether the shopper had granted analytics consent. Do not include a shopper photo or full customer profile unless support specifically requests it through an approved channel. # Privacy and consent Source: https://docs.virtual.fit/operations/privacy-and-consent Configure shopper notices, photo handling, retention, and analytics consent for virtual.fit. virtual.fit processes a shopper photo to create an AI try-on preview. Give shoppers clear information before upload and collect any consent required for your storefront and jurisdiction. This guide is operational guidance, not legal advice. Your business remains responsible for its privacy notice, lawful basis, consent experience, and merchant-specific terms. ## Shopper-facing facts Your notice should explain that: * The result is an AI visualization and may differ from physical fit, size, color, or proportion. * The shopper must be at least 18 years old. * The shopper must own the uploaded photo or have the pictured person's explicit permission. * Photos of minors and unlawful or rights-infringing content are prohibited. * Uploads and generated try-on images are automatically deleted within 24 hours. * Photos and results are not used for marketing, portfolios, reference material, or model training unless separate consent is obtained where required. * Results are for the shopper's personal, non-commercial use. The default virtual.fit terms cover these points. If you replace them, preserve the substance and have the final copy reviewed for your business. ## Configure the notice ### Shopify Open **Shopify theme editor → App embeds → Virtual Fitting Room**. Review: * Disclaimer language. * Short disclaimer. * Full terms. * Optional email collection and validation. * Daily-limit message. Test every storefront language you publish. ### Custom JavaScript Set `termsSummaryHtml`, `termsFullHtml`, and `termsFullSelector` in the loader configuration. Use your own selector only when the full terms already exist on the page. [Configure terms and copy →](/custom-js/styling-and-copy) ## Analytics consent Custom storefronts can switch between identified and cookieless measurement: ```javascript theme={null} virtualfit( 'setConsentMode', analyticsAllowed ? 'consented' : 'cookieless' ); ``` Call this after your consent manager resolves the shopper's choice and whenever that choice changes. | Mode | Use it when | | ------------ | ------------------------------------------------------------------------- | | `consented` | Your storefront may include the shopper's resolved identity in analytics. | | `cookieless` | Analytics should omit shopper identity. | Do not send email or customer ID before the appropriate consent or other lawful basis is in place. ## Retention and deletion Shopper uploads and generated try-on images are temporary and automatically deleted within 24 hours. A result may remain visible in the dashboard as a deleted record after its image is removed. If you download, export, or copy a result into another system, that copy falls under your own retention and deletion process. ## Launch review * [ ] The disclaimer is visible before a shopper starts a try-on. * [ ] Full terms open and are readable on mobile. * [ ] Retention and AI-preview limitations are accurate. * [ ] Email collection matches your privacy notice. * [ ] Analytics consent changes are reflected in the integration. * [ ] Your support team can handle access and deletion requests. * [ ] Only authorized staff can view generated results. See the public [virtual.fit privacy policy](https://virtual.fit/privacy) and [terms](https://virtual.fit/terms) for the current service-level language. # Quickstart Source: https://docs.virtual.fit/quickstart Choose Shopify or Custom JavaScript and complete your first virtual.fit try-on. Your first successful setup should prove one complete path: virtual.fit appears on an eligible product page, a shopper completes a try-on, and the result reaches your dashboard. Open the virtual.fit setup, choose **Shopify**, enter your `.myshopify.com` store name, and select **Install on Shopify**. Approve the Shopify install. Return to the setup checklist and select **Open virtual.fit in Shopify** if asked to finish linking the store. Click **Open theme editor**. In Shopify's **App embeds** panel, turn on **Virtual Fitting Room**, then click **Save**. virtual.fit automatically prepares eligible apparel on the first connection. Confirm at least one garment is **Active** and ready. Open the Active product's storefront URL. Confirm **Try On** appears once over the main product media and complete a try-on. The setup is working when the generated image appears on the product page and under **Virtual Fitting Room → Results**. [Continue with the Shopify guide →](/shopify/install) Open the virtual.fit setup, choose **Custom JS**, and save the exact production origin, such as `https://shop.example.com`. Import a product by CSV or management API. Its ID or handle must match the value exposed by the product URL. Choose a rule such as `/products/:handle`. Paste a real product URL into the live tester and confirm it resolves to the available product. Copy the generated snippet from virtual.fit. Point `mount` at the main product media wrapper and load the exact hosted script URL shown for your site. Open the available product URL, complete a try-on, and confirm the result appears under **Results**. The loader stays hidden on non-product pages, unmatched URLs, disabled products, and products without usable garment images. [Continue with the Custom JavaScript guide →](/custom-js/quickstart) Test on a staging theme or staging origin first. Use the same product IDs, handles, and mount selector that production will expose. # Recommendations API Source: https://docs.virtual.fit/recommendations/api Rank similar, complete-the-look, and likely-purchase recommendations from your backend. Use `POST /recommendations` to rank products from a Shopify or Custom JavaScript catalog. Call this endpoint from a trusted backend with your virtual.fit API key. Never expose your API key in browser JavaScript, a theme file, or a mobile application. Send requests to `https://api.virtual.fit`. ## Request ```bash theme={null} curl --request POST \ "https://api.virtual.fit/recommendations" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "site_key": "site_pub_your_key", "intent": "complete_the_look", "product_ids": ["linen-shirt", "tailored-trousers"], "cart_product_ids": ["canvas-tote"], "exclude_product_ids": ["sold-out-belt"], "shopper_id": "anon-session-7f19b2", "limit": 8, "surface": "outfit_builder" }' ``` ```bash theme={null} curl --request POST \ "https://api.virtual.fit/recommendations" \ --header "Authorization: Bearer $VIRTUAL_FIT_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "shop_domain": "your-store.myshopify.com", "intent": "similar", "product_ids": ["gid://shopify/Product/9876543210"], "shopper_id": "customer-48291", "limit": 8, "surface": "product_page" }' ``` ### Body fields | Field | Required | Description | | ----------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `site_key` | For Custom JavaScript | The public site key owned by the API-key account. | | `shop_domain` | For Shopify | The store's canonical `.myshopify.com` domain. | | `intent` | Yes | `similar`, `complete_the_look`, or `likely_purchases`. See [Intent semantics](#intent-semantics). | | `product_ids` | By intent | Exactly one ID for `similar`; one to five outfit products for `complete_the_look`; optional current or selected products for `likely_purchases`. For `complete_the_look`, put the primary outfit item first. | | `cart_product_ids` | For a live cart | The latest full cart, up to 500 product IDs. Required for cart-only `likely_purchases` requests. Cart items are excluded from results and influence multi-item ranking, but do not occupy outfit categories. | | `candidate_product_ids` | No | Restrict ranking to a non-empty array of at most 10,000 product IDs. Useful when your backend has already applied availability, market, or collection filters. | | `exclude_product_ids` | No | Up to 500 product IDs that must not appear. Use this as an explicit availability or merchandising override. Context products are excluded automatically. | | `shopper_id` | Recommended for shopper-facing requests | Your stable, opaque customer or anonymous-session identifier. virtual.fit uses it only to keep one shopper from consuming the store's shared request allowance. Do not send an email address or other directly identifying value. | | `limit` | No | Maximum results. Defaults to `12` and is capped at `100`. | | `surface` | No | Your placement label, such as `product_page`, `cart`, or `fitting_room`. | Use the same stable IDs that you send during catalog sync and commerce tracking. For Shopify, send the full GraphQL product ID, such as `gid://shopify/Product/9876543210`. Unknown or disabled candidate IDs are ignored. If `candidate_product_ids` is present, it must be an array containing at least one ID, and at least one supplied ID must resolve to an enabled product; otherwise the request fails with `400`. Omitting the field leaves ranking open to the enabled catalog. A request fails when none of its ranking context is prepared. The JSON body is limited to 1 MiB. Each product ID and `shopper_id` is limited to 256 UTF-8 bytes. Requests over a body, identifier, or array limit fail with `413`. ## Response ```json theme={null} { "items": [ { "product_id": "leather-loafer", "target_type": "variant", "variant_id": "black-42", "recommended_option_values": { "color": "Black", "size": "42" }, "rank": 1, "score": 1.274, "title": "Leather Loafer", "handle": "leather-loafer", "canonical_url": "https://shop.example/products/leather-loafer?variant=black-42", "image_url": "https://cdn.example.com/leather-loafer-black.jpg", "variant_title": "Black / 42", "price": "129.0000", "compare_at_price": "159.0000", "currency": "USD", "available": true, "fit_evidence": { "review_count": 128, "analyzed_review_count": 42, "average_rating": 4.7, "signals": [ { "dimension_code": "overall", "evidence_count": 34, "average_score": 0.03, "tight_count": 5, "neutral_count": 25, "loose_count": 4 } ] } } ], "unknown_context_ids": [] } ``` `rank` defines the display order. `score` is optional and meaningful only within that response. Do not re-sort items by score or compare scores across requests. Each item includes the selected target plus the product fields needed for a card. It deliberately omits full galleries, sibling variants, and complete option matrices. | Field | Meaning | | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `target_type` | `variant` for one exact purchasable choice, `visual_group` for a best color/style without choosing every purchase option, or `product` when no narrower target is available. | | `variant_id` | Stable source variant ID when `target_type` is `variant`; otherwise `null`. | | `recommended_option_values` | The selected color/style and, for an exact variant, its full option selection. Apply these values before falling back to storefront defaults. | | `canonical_url` | Exact variant URL when available, otherwise the product URL. | | `image_url` | One prepared display image for the selected target. | | `price`, `compare_at_price`, `currency` | Selected variant pricing with product pricing as the fallback. Amounts are decimal strings. | | `available` | `true` when current availability is known; `null` when the source does not provide reliable inventory. Known-unavailable targets are omitted. | | `fit_evidence` | Optional compact rating and fit summary. `review_count` is the source aggregate; `analyzed_review_count` is the number of full reviews available for fit analysis. Full review text and media are not included in recommendation cards. | virtual.fit returns at most one item per product. A visually best color can be returned as `visual_group` without inventing a size; an exact in-stock variant can be returned as `variant`. `unknown_context_ids` contains supplied context IDs that are not prepared in the selected catalog. The request can still succeed when at least one other context product is available. ## Same-category recommendations Send exactly one context product: ```json theme={null} { "site_key": "site_pub_your_key", "intent": "similar", "product_ids": ["linen-shorts"], "limit": 12 } ``` You may also send `candidate_product_ids` when your backend has a more specific constraint, such as an in-stock collection or shopper market. You do not need to send a category. virtual.fit categorizes prepared products automatically. Keep Custom JavaScript product titles and images current so `similar` can return relevant alternatives. Recommendation eligibility is broader than try-on eligibility. Apparel accessories such as shoes, bags, and jewellery can appear in recommendation results even when they are not supported as virtual try-on items. ## Intent semantics ### `complete_the_look` The hosted fitting room uses this intent automatically. Call it directly for another outfit placement or your own outfit builder. It excludes categories already represented by known context products. If no eligible compatible product remains, `items` can be empty. Treat that as a valid result instead of widening it to unrelated products. Send one to five products already selected for the outfit. Send the current cart separately when it should also influence relevance: ```json theme={null} { "site_key": "site_pub_your_key", "intent": "complete_the_look", "product_ids": [ "linen-shirt", "tailored-trousers", "suede-jacket" ], "cart_product_ids": ["canvas-tote"], "limit": 8 } ``` Only `product_ids` determines which outfit categories are already occupied. `cart_product_ids` improves the ranking and is excluded from results, but a bag sitting in the cart does not prevent the outfit builder from recommending another bag. ### `likely_purchases` Use this for “You may also like,” cart, post-add-to-cart, and general cross-sell placements. It uses the same current-product context and learned purchase behavior, but it does not remove categories already represented in that context: ```json theme={null} { "site_key": "site_pub_your_key", "intent": "likely_purchases", "cart_product_ids": ["linen-shirt", "tailored-trousers"], "limit": 8, "surface": "cart" } ``` `likely_purchases` accepts a current product, selected products, a cart, or any combination of them. All supplied products are excluded automatically. Your backend must send the latest full cart in `cart_product_ids`; it affects that request immediately. Synced cart and purchase events can improve recommendations over time. ## Error handling ### Rate limits The recommendations API uses short-term safety thresholds of `60` requests per shopper per minute and `6,000` requests per store per minute. Treat these values as usage guidance rather than exact quotas, and always handle `429` responses. Send `shopper_id` on shopper-facing backend requests. Different shoppers then use separate allowances even when every request leaves your infrastructure through the same IP address. Authenticated requests are not limited by the merchant backend's shared egress IP. The hosted Shopify and Custom JavaScript browser integrations supply shopper identity automatically. Direct browser requests also use a short-term safety threshold of `600` requests per IP per minute. Treat it as usage guidance and handle `429` responses. Rate-limited requests return `429` with `Retry-After` and `retry_after_seconds`. Wait for that duration before retrying. Keep your existing merchandising order visible while waiting. | Status | Meaning | | ------ | -------------------------------------------------------------------------------------------------------------------------------- | | `400` | The integration selector, intent, product count, or supplied candidate set is invalid. | | `401` | The API key is missing or invalid. | | `413` | The JSON body, a product-ID array, a product ID, or `shopper_id` exceeds its documented limit. | | `429` | The shopper, store, or public client IP exceeded a short-term safety limit. Wait for the `Retry-After` duration before retrying. | | `404` | The requested storefront is missing or inaccessible, or none of the context products are prepared. | | `503` | Recommendations are temporarily unavailable. Retry with backoff or use your existing fallback order. | Keep your current merchandising order as a fallback. A temporary recommendation failure should not hide eligible products or block checkout. # Product recommendations Source: https://docs.virtual.fit/recommendations/overview Recommend related products for the fitting room, product pages, and carts. virtual.fit can rank your prepared catalog from the products a shopper is viewing, trying on, or buying. The same recommendation system supports the fitting room and server-to-server API requests. ## Recommendation modes | Intent | Use it for | Context | | ------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------- | | `similar` | More shorts, dresses, or other alternatives to the current product | Exactly one product | | `complete_the_look` | The next compatible category for the hosted fitting room, or for a custom outfit builder | One to five products | | `likely_purchases` | Products the shopper is likely to buy next, including same- or cross-category suggestions | Current/selected products, the current cart, or both | Both multi-item intents become more specific as you add context. For example, a suggestion based on a shirt and trousers can account for both items instead of averaging separate recommendation lists. `complete_the_look` suppresses categories already represented in the outfit. `likely_purchases` does not, so it can recommend another shirt as well as shoes or an accessory. `complete_the_look` can return an empty result when no compatible category remains. Do not replace it with unrelated products. ## Where recommendations appear ### Shopify The hosted Shopify fitting room uses `complete_the_look` automatically. The merchant does not need to implement its recommendation rows. Theme scripts can request recommendations for additional placements after the app embed loads: ```javascript theme={null} const result = await window.VirtualFit.recommend({ intent: 'complete_the_look', excludeProductIds: ['sold-out-belt'] }); ``` ### Custom JavaScript The hosted fitting room uses `complete_the_look` automatically with the current product and products already selected in the outfit. Keep those products up to date through the Custom JavaScript integration. Custom placements can call the browser API directly, including with explicit cart or product context. ### Your backend Use the [recommendations API](/recommendations/api) for product-page alternatives, complete-the-look rows, cart cross-sells, and other server-rendered experiences. Use `likely_purchases` for general “You may also like” and cart recommendation placements. ## Keep recommendations current Recommendations use only products that are enabled and prepared in virtual.fit. Sync new and changed products under the same stable product ID. You do not need to republish the rest of your catalog. Use clear product images and accurate titles. Prefer full-product front, back, and side views on a model or mannequin; they provide stronger visual and fit context than flat-lay or isolated ghost images. Flat-lay and product-only images remain useful when a styled photo contains a complete outfit. virtual.fit analyzes and selects the strongest views automatically, so you do not need to create special crops or remove backgrounds. Products outside apparel and accessories are excluded. Accessories such as shoes, bags, and jewellery can still be recommended even when virtual try-on does not support them. ## Improve relevance with commerce events For Custom JavaScript storefronts, send cart and purchase line-item events with the same product IDs used by your catalog. These events can improve recommendations over time. The hosted fitting room automatically includes the current product and selected outfit items. Shopify also includes the current cart. For a Custom JavaScript storefront, pass the latest full cart as `cartProductIds`. Cart products influence both multi-item intents and are excluded from results, but only selected outfit products occupy `complete_the_look` categories. [Review the commerce event reference →](/custom-js/commerce-events) New products can be recommended before they accumulate commerce history. # Delete a product Source: https://docs.virtual.fit/reference/catalog-delete-product openapi.yaml DELETE /vfr/manage/sites/{site_id}/products/{product_id} Permanently remove a synced product and its managed images from the catalog. # Delete a variant Source: https://docs.virtual.fit/reference/catalog-delete-variant openapi.yaml DELETE /vfr/manage/sites/{site_id}/products/{product_id}/variants/{variant_id} Remove one exact source variant while keeping the product. # Enable or disable a product Source: https://docs.virtual.fit/reference/catalog-enable-product openapi.yaml PUT /vfr/manage/sites/{site_id}/products/{product_id}/enabled Change whether a synced product is available in the fitting room without deleting it. # Import catalog CSV Source: https://docs.virtual.fit/reference/catalog-import openapi.yaml POST /vfr/manage/sites/{site_id}/products/import Import current products and exact variant rows from a CSV file. The multipart field name is `file`. See [Sync the catalog](/custom-js/catalog#csv-format) for row inheritance, current columns, and delete rows. # Sync product reviews Source: https://docs.virtual.fit/reference/catalog-reviews openapi.yaml POST /vfr/manage/sites/{site_id}/products/{product_id}/reviews Optionally sync complete customer review records and fit evidence. Review sync is optional. Upload the product first, then send review batches whenever your review source changes. Prefer a stable `external_review_id`. A public `permalink` is the next-best identity. If neither exists, virtual.fit derives a conservative identity from the available author, date, rating, title, and body. Each item is its complete current review record. Include its current stars, text, purchased variant, and media on every update. To delete one review, send its stable ID or permalink with `deleted: true`. Use `snapshot_complete: true` only when the batch contains every current review in the named `partition_key`. Omitted reviews become inactive after two consecutive complete snapshots. Leave it `false` for pages, partial feeds, and incremental updates. virtual.fit extracts fit evidence from review text asynchronously. You only need to send `fit_signals` when the source already provides an explicit structured vote such as “runs small” or “true to size.” # Create or update a product Source: https://docs.virtual.fit/reference/catalog-upsert openapi.yaml PUT /vfr/manage/sites/{site_id}/products/{product_id} Create a catalog product or progressively patch its current data. Use a stable `product_id` in the URL. A new product needs `title` and at least one image; later requests may send only changed fields. # Recommend products Source: https://docs.virtual.fit/reference/recommend-products openapi.yaml POST /recommendations Return compact, render-ready product and selected-variant recommendations. The response contains one selected target per product and omits full variant and media collections. See [Recommendation behavior](/recommendations/api#response) for target semantics and fallbacks. # Catalog image Source: https://docs.virtual.fit/reference/schemas/catalog-image Shared product media and view metadata. # Catalog option Source: https://docs.virtual.fit/reference/schemas/catalog-option Choice axes, controlled sizing metadata, values, and swatches. # Catalog product input Source: https://docs.virtual.fit/reference/schemas/catalog-product Product-level fields for current JSON catalog writes. # Catalog size chart Source: https://docs.virtual.fit/reference/schemas/catalog-size-chart A reusable product-wide or option-scoped size-chart reference. # Catalog variant Source: https://docs.virtual.fit/reference/schemas/catalog-variant One exact purchasable option combination with price and inventory. # Recommendation item Source: https://docs.virtual.fit/reference/schemas/recommendation-item Compact product and selected-target fields returned for display. # Get storefront fit evidence Source: https://docs.virtual.fit/reference/storefront-fit-evidence openapi.yaml GET /vfr/sites/{site_key}/fit-evidence Read a compact rating and fit summary for a Custom JavaScript product. Call this endpoint from the configured storefront origin. It returns the source-reported overall rating and review count, a small analyzed fit digest, and up to three relevant review previews. Pass the same stable `product_id` used during catalog sync. Optional `variant_id` and `size` values narrow the preview reviews; they do not expand the response with the full variant matrix or every review. Use [List storefront reviews](/reference/storefront-product-reviews) when a shopper chooses to inspect the underlying evidence. # List storefront reviews Source: https://docs.virtual.fit/reference/storefront-product-reviews openapi.yaml GET /vfr/sites/{site_key}/reviews Read full, paginated review evidence for a Custom JavaScript product. Call this endpoint from the configured storefront origin when the shopper wants the underlying reviews. Each item can include its stars, full text, purchased options, customer photos or videos, reported measurements, and extracted fit signals. Results are limited to 50 reviews per page. Pass the returned `next_cursor` unchanged to load the next page. Optional `variant_id` and `size` filters help surface evidence that matches the shopper's current selection. # Configure Shopify Source: https://docs.virtual.fit/shopify/configure Configure storefront appearance, customer access, limits, and shopper copy. Use Shopify's theme editor for storefront presentation. Use virtual.fit for product availability, customer access, and usage limits. ## Theme editor settings Open **Shopify admin → Online Store → Themes → Customize → App embeds → Virtual Fitting Room**. ### Button and guidance | Setting | What it changes | | -------------------------- | ---------------------------------------------------- | | **Button Text** | Label shown on the product media control. | | **Upload Hint Text** | Photo guidance shown before upload. | | **Generate Button Text** | Label on the action that starts a try-on. | | **Try-On Button Position** | Left or right placement over the main product media. | Use short labels that fit narrow mobile galleries. Keep upload guidance specific: ask for a clear, well-lit photo showing the shopper from the front. ### Appearance Turn on **Customize Appearance** to set: * Background color and opacity. * Text color. * Theme font preset. * Border style, color, and thickness. * Theme, custom, or pill corner style. Use **Advanced CSS Overrides** only when the standard controls cannot match your theme. Re-test custom values after theme updates. ### Product card badges Product card badges can show which products support try-on before a shopper opens the product page. * Turn **Show Try-On Badges on Product Cards** on or off. * Set the badge text and left or right placement. * Reuse the try-on button appearance or style the badge separately. Confirm badges appear only on Active products and never cover pricing, sale, or inventory badges. Check both collection grids and search results on mobile. ### Terms and email The app embed supports: * Automatic language detection, English, or Estonian disclaimer copy. * A custom short disclaimer and full terms. * Optional email collection. * Required email validation when collection is on. * A custom daily-limit message. Merchant terms and privacy notices are your responsibility. Review custom legal copy with your counsel. Describe results as AI previews, not guarantees of physical fit, size, color, or proportion. ## virtual.fit settings Open **Setup** in virtual.fit. Choose **Allow anonymous** for the lowest-friction experience, or **Require login** when every try-on must be tied to a known customer. If login is required, verify that Shopify returns the shopper to the same product page. Set how many try-ons one shopper may start per day. Test the limit message so it gives the shopper a clear next step. Shopper uploads and generated results are automatically deleted after 24 hours. Treat exported or downloaded files according to your own privacy policy. Safety checks are always applied to shopper uploads. There is no storefront setting required to turn them on. ## Recommended order Wait for initial preparation to finish, then check a representative group of apparel products. Decide whether signed-out shoppers can use virtual.fit and choose a suitable daily limit. Configure placement, button appearance, badges, and copy in the theme editor. Confirm terms, photo guidance, email behavior, and translated text. Test signed in, signed out, limit reached, rejected photo, generation failure, and successful completion. Theme settings change presentation only. Product state, plan limits, and customer access continue to apply. # Install on Shopify Source: https://docs.virtual.fit/shopify/install Connect Shopify, activate the virtual.fit app embed, and verify your first product page. The Shopify integration connects your catalog and adds virtual.fit through a theme app embed. You do not need to edit Liquid or paste JavaScript into your theme. ## Before you begin You need: * Permission to install apps on the Shopify store. * Permission to customize and save the target theme. * Workspace owner or admin access in virtual.fit. * At least one apparel product with clear product images. Shopify app embeds are off by default after installation. Activate the virtual.fit embed separately in every theme you publish. ## Install and connect Open your virtual.fit setup, choose **Shopify**, and enter the store name from `your-store.myshopify.com`. Select **Install on Shopify**, review the requested permissions, and approve the installation in Shopify admin. Start from virtual.fit so the store connects to the correct workspace. Return to the setup checklist. If asked, select **Open virtual.fit in Shopify** and complete the connection from the embedded app. On the first connection, virtual.fit imports and prepares eligible apparel up to your plan limit. You can continue with theme setup while this runs. Keep the preparation page open if requested. This first-time step may take several minutes for a large catalog. Select **Open theme editor** in virtual.fit. You can also go to **Shopify admin → Online Store → Themes → Customize → App embeds**. Turn on **Virtual Fitting Room**, then select **Save**. The integration overlays the product gallery, so you do not need to place an app block in the product template. Shopify documents app embed activation under **Theme settings → App embeds** in its [theme app extension guide](https://shopify.dev/docs/apps/build/online-store/theme-app-extensions/configuration#app-embed-blocks). ## Verify the installation Wait until at least one apparel product is **Active** and ready, then open its public storefront URL. A correct installation has all of these behaviors: * **Try On** appears once over the main product media. * The interface opens without leaving the product page. * An inactive product does not show the control. * A completed try-on appears under **Results** in virtual.fit. The theme editor preview is useful for placement, but it does not replace a test on the saved public or password-protected storefront. ## When you change themes App embed state belongs to the theme. After publishing a different theme: 1. Open that theme in the theme editor. 2. Activate **Virtual Fitting Room** under **App embeds**. 3. Save the theme. 4. Repeat the storefront launch checks. The app embed does not permanently modify your theme's Liquid source. Turning off the app embed is the fastest storefront rollback. ## Next steps Set placement, appearance, customer access, limits, and shopper copy. Understand preparation, recommendation readiness, and product images. # Prepare Shopify products Source: https://docs.virtual.fit/shopify/products Review product preparation, Active status, recommendation readiness, and garment images. On the first Shopify connection, virtual.fit imports products, variants, prices, inventory, option values, swatches, and media. It begins preparing eligible apparel up to your plan limit while you configure the storefront. Later Shopify updates keep the catalog in sync. Products with many variants do not require separate preparation for every size when they share the same garment media. ## Preparation status Product status tells you what is ready for shoppers. | Status | What it means | What to do | | ------------------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------------- | | **Preparing** | Product images are still being reviewed. | Wait for preparation to finish before storefront testing. | | **Active** | The product may show virtual.fit when its garment images are ready. | Test its live product page. | | **Inactive** | virtual.fit stays hidden for this product. | Activate it when you want to offer try-on. | | **Recommendations ready** | The product can participate in outfit and complementary-product suggestions. | No action needed. | | **Preparing recommendations…** | Recommendation preparation is still running. | Check again later. | | **Recommendations unavailable** | Recommendations are not available for this product. | Try-on may still work if garment preparation is complete. | Recommendation readiness is separate from try-on readiness. A product can support virtual try-on even when recommendations are unavailable. ## Review the first product In virtual.fit, open **Setup** and search for a representative garment. Activate the product if needed. Use **Activate All** or **Deactivate All** only after testing a smaller group. After preparation finishes, open **Details** and review the available garment views. Turn off duplicated, obstructed, unrelated, or inaccurate images. Correct the image angle when needed. Open the product's storefront URL and complete a try-on before activating more products. ## Product images virtual.fit automatically syncs all available Shopify product and variant images, analyzes them, and chooses the strongest views. You do not need to select or upload a separate copy of each Shopify image. The strongest fit references have these qualities: | Prefer | Avoid | | ------------------------------------------ | ------------------------------------------ | | A clear front view | Crops that omit most of the garment | | A back view when the back matters | Collages, size charts, logos, or packaging | | Consistent lighting and accurate color | Heavy filters or color-altering edits | | One primary garment per image | Multiple different products in one frame | | Full-product views on a model or mannequin | Blurry, tiny, or highly compressed images | A star identifies the strongest image for an angle. Use quality indicators as guidance and inspect the image itself before deciding. Front, back, and side views give virtual.fit the strongest fit reference. Flat-lay and isolated ghost images are still accepted, but model or mannequin images generally produce more accurate results. If you have useful fit-reference images that you do not want to list in the public Shopify product gallery, open the product's **Details** in virtual.fit and upload them there. For example, you can add full-product front, back, or side views on a model or mannequin without changing the product page gallery. ## Product eligibility A product page shows virtual.fit only when: * The Shopify product is present in virtual.fit. * The product is **Active**. * Preparation found at least one usable garment image. * The app embed is active in the current theme. Virtual try-on is intended for supported apparel such as tops, bottoms, dresses, and similar garments. Non-apparel and unsupported products remain hidden. ## Make image corrections Use **Details** to: * Turn individual images on or off. * Correct an image's angle. * Upload a replacement garment image. * Remove a manually uploaded image. * Refresh preparation after Shopify media changes. * Add a short product-specific visual instruction when necessary. Keep instructions concrete and visible, for example: `Preserve the silver buttons and cropped hem.` Do not use instructions to contradict the catalog image. ## After catalog changes After changing product media, title, handle, variants, price, or availability in Shopify: 1. Refresh the product in virtual.fit. 2. Prepare it again when the media changed. 3. Confirm the garment image set. 4. Re-test the live product page. Changing a Shopify handle also changes the product URL. Re-test storefront behavior and update campaign or QA links. ## Recommendations and stock virtual.fit shows at most one recommendation for the same product. It selects the best visual match, then uses fresh Shopify inventory to choose an in-stock variant when possible. If the best exact variant is sold out, virtual.fit may select another in-stock size from the same visual choice. It does not substitute a different color or pattern unless that visual choice is the better recommendation. ## Scale up safely Start with a representative group across garment categories, image styles, and product templates. Once they pass the [launch checklist](/getting-started/launch-checklist), activate more products up to your plan limit. # Troubleshoot Shopify Source: https://docs.virtual.fit/shopify/troubleshooting Resolve Shopify installation, preparation, theme embed, and storefront issues. Start with the affected product page, then compare it with one known-good Active product. ## Try On does not appear Check these conditions in order: 1. **App connected** — Your Shopify store appears as connected in virtual.fit. 2. **Account linked** — The setup checklist does not ask you to finish linking in Shopify. 3. **Correct theme** — **Virtual Fitting Room** is on under **App embeds** in the theme serving the page. 4. **Theme saved** — The theme editor has no unsaved changes. 5. **Product Active** — The exact Shopify product is Active in virtual.fit. 6. **Preparation complete** — Product **Details** show at least one usable garment image. 7. **Real storefront test** — You are testing the saved storefront, not only the editor preview. The control intentionally stays hidden on Inactive products, unsupported products, and pages that are not product pages. ## The store is still preparing Initial catalog preparation can take several minutes, especially for a large catalog. You can activate the app embed and configure its appearance while it runs. * Keep the preparation page open if prompted. * Wait until at least one product changes from **Preparing** to **Active** and ready. * Refresh the catalog view if progress has not updated. * Confirm the Shopify app is still installed and connected. If the same product remains in preparation for an unusually long time, record its Shopify product ID and contact support. ## Recommendations are unavailable Recommendation readiness does not block try-on. If the product is Active and has a usable garment image, test the fitting room normally. For a product stuck on **Preparing recommendations…**, allow preparation to finish. Include the product ID and approximate start time if you contact support. ## Theme setup stays incomplete After activating and saving the app embed: 1. Open an Active product on the storefront in a new tab. 2. Hard refresh the page. 3. Return to virtual.fit and refresh the setup checklist. 4. Confirm you edited the theme that serves that URL. For password-protected stores, enter the storefront password before testing. ## The control is misplaced * Test product thumbnails, media zoom, and sticky layouts. * Check desktop and mobile product templates separately. * Temporarily turn off other overlays to identify a conflict. * Record the theme name, version, product URL, and screenshots before contacting support. Do not paste a second copy of the integration into theme code. This can create duplicate controls and measurements. ## A product became Inactive virtual.fit can mark a product Inactive when it cannot find supported garment content. * Confirm the product is apparel. * Open **Details** and review its images. * Add a clear garment image when the Shopify media is unsuitable. * Prepare the product again. ## The result does not enter the gallery * Test after selecting different variants. * Close image zoom and the media carousel before another test. * Check whether another theme app replaces the gallery after the page loads. * Confirm the try-on completed under **Results** in virtual.fit. If the result appears in virtual.fit but not on the product page, capture a screen recording of the affected flow. ## Analytics are incomplete * Confirm the Shopify app remains installed and connected. * Reconnect Shopify if virtual.fit shows a permissions warning. * Allow time for recent activity to appear. * Use one distinctive test product and order. * Confirm your storefront consent settings allow the expected measurement. ## Contact support Include: * Your `.myshopify.com` domain. * Theme name and version. * Affected product URL and Shopify product ID. * Product status and preparation status. * Desktop or mobile browser and version. * Screenshot or screen recording. * Visible browser errors, if any. * Approximate test time and timezone. Contact [virtual.fit support](https://virtual.fit/support) with this information.