This page documents the new Vitrin product functions and explains the arguments needed to use them (with the matching old Zid call where relevant).
All functions are available via window.zid.products.
Get Product#
New: zid.products.get(product_id)
Old: zid.store.product.fetch(id)Description: Retrieve the product by id
Get Product Options#
New: zid.products.getProductOptions(product_id, params?)Arguments#
product_id (string, required) — Product identifier.
params (object, optional):attributes (object) — Map of attribute_id → attribute_value_id (UUIDs).
option_fields (object) — Map of option_group_id → array of selected option_ids (UUIDs).
input_fields (string[]) — Array of input_field_ids (UUIDs) that currently have values.
Response returns an updated ProductObject (resolved variant, price, stock) based on your selections.
Example params (placeholders)#
IDs come from the product object (all are UUIDs).
Reviews (Read)#
New: zid.products.reviews(product_id, { page?, page_size? })
Old: zid.store.product.getReviews(id, page)Arguments#
product_id (string, required)
params (object, optional):
Reviews (Create)#
New: zid.products.createReview(product_id, payload)
Old: zid.store.product.addReview(id, reviewForm, rating, is_anonymous)Arguments#
product_id (string, required)
payload (object, required):rating (number, required) — 1..5
Customer Reviews (Mine)#
New: zid.products.getCustomerReviews({ product_id })
Old: zid.store.product.getCustomerReviews(id, orderId)Arguments#
params (object, required):product_id (string, required)
Change: orderId is not used in the new API.
Questions (List)#
New: zid.products.questions(product_id, params?)Description: Retrieve all questions asked about a product.Parameters#
product_id (string, required) — Product identifier.
params (object, optional) — Optional query parameters:page (number) — Page number for pagination.
page_size (number) — Number of questions per page.
Questions (Create)#
New: zid.products.createQuestion(product_id, payload)
Old (used): zid.store.product.addQuestion(id, question, name, email, is_anonymous)Arguments#
product_id (string, required)
payload (object, required):question (string, required)
Bundle Offer (List)#
New: zid.products.bundleOffers(params?)
Old (used): zid.store.product.getProductBundleOffer(id)Arguments#
params (object, optional):product_ids (array, optional)
Example params (placeholders)#
Stock Alerts#
New: zid.products.stockAlerts({ product_id }, payload)Description: Subscribe to stock alerts for a product. Customers will be notified when the product is back in stock.Parameters#
product_id (string, required) — Product identifier.
payload (object, required) — Subscription details containing customer information.
Payload Structure#
customer_email (string, required) — Customer's email address for notifications.
customer_phone_number (string, optional) — Customer's phone number.
customer_name (string, optional) — Customer's name.
Get Bundle Offer (Single Product)#
New: zid.products.getBundleOffer(product_id)Description: Get bundle offers specifically for a single product.Parameters#
product_id (string, required) — Product identifier.
Notes#
Keep calls minimal: pass only the arguments you need.
All IDs (attributes, option_fields, input_fields) are UUIDs from the product object. They are provided dynamically, you don’t hardcode them.
Modified at 2026-02-17 07:02:10