/** * An object representing an address. */ export interface CartAddress { /** * First name. * @requiredField firstName */ firstName: string; /** * Last name. * @requiredField lastName */ lastName: string; /** * Email address. * @requiredField email */ email: string; /** * Phone number. * @requiredField phone */ phone: string; /** * Address. * @requiredField address */ address: string; } /** * An object representing a coupon applied in a shopping cart. */ export interface CartAppliedCoupon { /** * Coupon code. * @requiredField code */ code: string; /** * Coupon unique identifier. * @requiredField couponId */ couponId: string; /** * Coupon name. * @requiredField name */ name: string; /** * Type of coupon. * One of: * * + `"BuyXGetY"` * + `"FixedPriceAmount"` * + `"FreeShipping"` * + `"MoneyOffAmount"` * + `"PercentOffRate"` * @requiredField couponType */ couponType: string; /** * Value of the coupon discount. * @requiredField discountValue */ discountValue: string; } /** * An object representing a visitor who abandoned a shopping cart. */ export interface CartBuyerInfo { /** * Buyer's unique ID. * @requiredField id */ id: string; /** * Buyer's email address. * @requiredField email */ email: string; /** * Buyer's first name. * @requiredField firstName */ firstName: string; /** * Buyer's last name. * @requiredField lastName */ lastName: string; /** * Buyer's identity. * One of: * * + `"ADMIN"`: Buyer is the site owner. * + `"MEMBER"`: Buyer is a logged-in site member. * + `"VISITOR"`: Buyer is not logged in. * + `"CONTACT"`: A contact has been created for the buyer. * @requiredField identityType */ identityType: string; /** * Buyer's phone number. * @requiredField phone */ phone: string; } /** * An object representing a custom text field. */ export interface CartCustomTextField { /** * Field title. * @requiredField title */ title: string; /** * Field value. * @requiredField value */ value: string; } /** * An object representing a line item in a shopping cart. */ export interface CartLineItem { /** * Cart line item ID. * @requiredField id */ id: number; /** * Name of the line item. * @requiredField name */ name: string; /** * Notes about the line item. * @requiredField notes */ notes: string; /** * Line item price. * @requiredField price */ price: string; /** * Line item product ID. * @requiredField productId */ productId: string; /** * Line item quantity. * @requiredField quantity */ quantity: number; /** * Line item stock keeping unit. * @requiredField sku */ sku: string; /** * Total price charged to the customer for all line items after any applicable discounts. * @requiredField totalPrice */ totalPrice: string; /** * Line item weight. * @requiredField weight */ weight: string; /** * Type of the line item. * One of: * * + `"DIGITAL"`: Digital item. * + `"PHYSICAL"`: Physical item. * + `"CUSTOM_AMOUNT_ITEM"`: Item with a custom price. * + `"UNSPECIFIED"`: Type can't be classified due to an error. * @requiredField lineItemType */ lineItemType: string; /** * Line item options. * @requiredField options * @servicePath wix-stores-frontend.Option */ options: Option[]; /** * Media item. * @requiredField mediaItem * @servicePath wix-stores-frontend.CartMediaItem */ mediaItem: CartMediaItem; /** * Custom text. * @requiredField customTextFields * @servicePath wix-stores-frontend.CartCustomTextField */ customTextFields: CartCustomTextField[]; } /** * An object representing a line item's primary media. */ export interface CartMediaItem { /** * Media item type. Currently only `"IMAGE"` type supported. * @requiredField type */ type: string; /** * Media item source for media uploaded to Wix (wix:image, wix:video or external URL). * @requiredField src */ src: string; } /** * An object representing a shopping cart. */ export interface CartObj { /** * Unique identifier of the shopping cart. * @requiredField _id */ _id: string; /** * Coupon applied in the shopping cart. * @requiredField appliedCoupon * @servicePath wix-stores-frontend.CartAppliedCoupon */ appliedCoupon: CartAppliedCoupon; /** * Cart billing address. * @requiredField billingAddress * @servicePath wix-stores-frontend.CartAddress */ billingAddress: CartAddress; /** * The buyer's information. * @requiredField buyerInfo * @servicePath wix-stores-frontend.CartBuyerInfo */ buyerInfo: CartBuyerInfo; /** * Cart status. Either `"INCOMPLETE"` or `"COMPLETE"`. * @requiredField status */ status: string; /** * Currency of the shopping cart. * @requiredField currency * @servicePath wix-stores-frontend.Currency */ currency: Currency; /** * The shopping cart's shipping information. * @requiredField shippingInfo * @servicePath wix-stores-frontend.CartShippingInfo */ shippingInfo: CartShippingInfo; /** * Items in the shopping cart. * @requiredField lineItems * @servicePath wix-stores-frontend.CartLineItem */ lineItems: CartLineItem[]; /** * The shopping cart's totals. * @requiredField totals * @servicePath wix-stores-frontend.OrderTotals */ totals: OrderTotals; /** * The order's units of weight. One of: `"KG"`, `"LB"`, or `"UNSPECIFIED_WEIGHT_UNIT"`. * @requiredField weightUnit */ weightUnit: string; } /** * An object representing shipping information. */ export interface CartShippingInfo { /** * Shipment address. * @servicePath wix-stores-frontend.CartAddress */ shippingAddress?: CartAddress; /** * Pickup address. * @servicePath wix-stores-frontend.CartAddress */ pickupInfo?: CartAddress; } /** * An object representing a currency. */ export interface Currency { /** * The currency code. * @requiredField currency */ currency: string; } /** * An object representing a media item. * * The `src` property of a `MediaItem` can be an image or video from the [Media Manager](https://support.wix.com/en/article/about-the-media-manager). * * The image source format for Media Manager images is: * `wix:image://v1//#originWidth=&originHeight=[&watermark=]` * * The video source format is: * `wix:video://v1//#posterUri=&posterWidth=&posterHeight=` */ export interface MediaItem { /** * Media item ID. * @requiredField id */ id: string; /** * Media item title. * @requiredField title */ title: string; /** * Media item description. * @requiredField description */ description: string; /** * Media items type. Can be "image" or "video." * @requiredField type */ type: string; /** * Media item URL. * @requiredField src */ src: string; /** * Thumbnail URL for videos only. */ thumbnail?: string; } /** * An object representing a line item option. */ export interface Option { /** * Name of the product option. * @requiredField option */ option: string; /** * Selected option. * @requiredField selection */ selection: string; } /** * An object representing an order's totals. */ export interface OrderTotals { /** * The subtotal of all the order's line items, excluding tax. * @requiredField subtotal */ subtotal: number; /** * The total shipping price, including tax. * @requiredField shipping */ shipping: number; /** * The total amount of tax. * @requiredField tax */ tax: string; /** * The total calculated discount amount. * @requiredField discount */ discount: number; /** * The total price. * @requiredField total */ total: number; /** * The total weight of the order's items. * @requiredField weight */ weight: number; /** * The total quantity of the the order's line items. * @requiredField quantity */ quantity: number; } /** * An object representing paging options. */ export interface PagingOptions { /** * Maximum number of variants to retrieve. Defaults to `300`. */ limit?: number; /** * Number of variants to skip before the retrieved variants. Defaults to `0`. */ skip?: number; } /** * An object representing a product variant's option choices. */ export interface ProductChoices { /** * Value of the choice. This key name is * dependent on the product option. For example, if a product * has a size option, this key value will be something like "Size" and its value * will be something like "Large". * * `optionKey` isn't case-sensitive. Therefore the values for the option keys "`Size`", "`SIZE`", and "`size`" are combined. * @requiredField optionKey */ optionKey: string; } /** * An object representing an option for a store product. */ export interface ProductOption { /** * Option type. Either `"color"` or `"drop_down"`. * @requiredField optionType */ optionType: string; /** * Option name. * @requiredField name */ name: string; /** * Option choices. * @requiredField choices * @servicePath wix-stores-frontend.ProductOptionsChoice */ choices: ProductOptionsChoice[]; } /** * An object representing all the available options for a store product, such as "Size" or "Color". * * An option can't be changed if it has choices and variants. To change an option, reset its variants with `resetAllProductVariantData()` or `resetVariantData()`. For each option, you can define a maximum of 6 choices. */ export interface ProductOptions { /** * Name of the option. This key name *  is dependent on the options added to the product. For example, if a product has a size * option, this key will be something like `"Size"`. * * `optionKey` isn't case-sensitive. Therefore the values for the option keys "`Size`", "`SIZE`", and "`size`" are combined. * @requiredField optionKey * @servicePath wix-stores-frontend.ProductOption */ optionKey: ProductOption; } /** * An object returned by `getProductOptionsAvailability()` representing the availability of a product. */ export interface ProductOptionsAvailability { /** * Whether the product with the specified option choices is available for purchase. * @requiredField availableForPurchase */ availableForPurchase: boolean; /** * An object representing all the available options for a store product. * @requiredField productOptions * @servicePath wix-stores-frontend.ProductOptions */ productOptions: ProductOptions; /** * Main product media item (image or video) URL. * @requiredField mainMedia */ mainMedia: string; /** * List of product media items. * @requiredField mediaItems * @servicePath wix-stores-frontend.MediaItem */ mediaItems: MediaItem; /** * The variant of the product selected using the specified option choices if there is one. * @requiredField selectedVariant * @servicePath wix-stores-frontend.ProductOptionsAvailabilitySelectedVariant */ selectedVariant: ProductOptionsAvailabilitySelectedVariant; } /** * An object representing the product variant selected with `getProductOptionsAvailability()`. */ export interface ProductOptionsAvailabilitySelectedVariant { /** * Product variant stock keeping unit value. * @requiredField sku */ sku: string; /** * Product variant currency. * @requiredField currency */ currency: string; /** * Product variant price. The variant price must be greater than its discount. * @requiredField price */ price: number; /** * Discounted product variant price. * @requiredField discountedPrice */ discountedPrice: number; /** * Product variant price formatted with the currency. * @requiredField formattedPrice */ formattedPrice: string; /** * Discounted product variant price formatted with the currency. * @requiredField formattedDiscountedPrice */ formattedDiscountedPrice: string; /** * Whether the product variant is shown in the store. * @requiredField visible */ visible: boolean; /** * Whether the product variant is in stock. * @requiredField inStock */ inStock: boolean; /** * Product variant weight. * @requiredField weight */ weight: number; } /** * An object representing an options choice for a store product, such as choice "Small" for the option "Size." * * You can define between 1 and 30 choices for each option. */ export interface ProductOptionsChoice { /** * Choice value. * @requiredField value */ value: number; /** * Choice description. * @requiredField description */ description: number; /** * Choice media. * @requiredField media * @servicePath wix-stores-frontend.ProductOptionsChoiceMedia */ media: ProductOptionsChoiceMedia; /** * Whether the product with this choice is in stock. * @requiredField inStock */ inStock: boolean; /** * Whether the product with this option is visible. * @requiredField visible */ visible: boolean; } /** * An object representing the choice media. */ export interface ProductOptionsChoiceMedia { /** * Main choice media item (image or video thumbnail) URL. * @requiredField mainMedia */ mainMedia: string; /** * List of choice media items. * @requiredField mediaItems * @servicePath wix-stores-frontend.MediaItem */ mediaItems: MediaItem; } /** * An object representing the selection of specific variants of a product. Use only one of * `choices` or `variantIds`. */ export interface ProductVariantOptions { /** * Choices of the retrieved variants. */ choices?: object; /** * IDs of the variants to retrieve. */ variantIds?: string[]; } export interface QuickViewOptions { /** * Product quantity to be displayed in the Quick View. Defaults to 1. * @requiredField quantity */ quantity: number; } /** * An object containing variant information to use when creating or updating variants. */ export interface VariantInfo { /** * Variant currency. * @requiredField currency */ currency: string; /** * Variant price. The variant price must be greater than its discount. If the variant price has been updated, changes to the product price don't affect the variant price. * @requiredField price */ price: number; /** * Discounted variant price. * @requiredField discountedPrice */ discountedPrice: number; /** * Variant price formatted with the currency. * @requiredField formattedPrice */ formattedPrice: string; /** * Discounted variant price formatted with the currency. * @requiredField formattedDiscountedPrice */ formattedDiscountedPrice: string; /** * Price per unit. * @requiredField pricePerUnit */ pricePerUnit: number; /** * Price per unit formatted with currency symbol. * @requiredField formattedPricePerUnit */ formattedPricePerUnit: string; /** * Variant weight. * @requiredField weight */ weight: number; /** * Variant stock keeping unit value. * @requiredField sku */ sku: string; /** * Whether the variant is visible in the store. * @requiredField visible */ visible: boolean; } /** * An object representing a product variant item. */ export interface VariantItem { /** * Unique variant ID. * @requiredField _id */ _id: string; /** * Choices of the retrieved variant in the form of an object containing a `key:value` pair for each variant choice. For example, if a variant has a size option, this key value will be something like "Size" and its value will be something like "Large". * @requiredField choices */ choices: object; /** * Variant information. * @requiredField variant * @servicePath wix-stores-frontend.VariantInfo */ variant: VariantInfo; } /** * An object representing product variants. */ export interface Variants { /** * List of variant items that match the specified choices or variant IDs. * @requiredField items * @servicePath wix-stores-frontend.VariantItem */ items: VariantItem[]; /** * Number of items in the current results page. * @requiredField length */ length: number; /** * Total number of variants with the specified choices. * @requiredField totalCount */ totalCount: number; } /** * Function that runs when a cart changes. * @param cart - The changed cart. * @requiredField cart * @servicePath wix-stores-frontend.CartObj */ export type CartChangedHandler = (cart: CartObj) => void;