API Reference
Last updated
Was this helpful?
Last updated
Was this helpful?
Product variant of a deal to be added to cart. Used by Deal.addVariantsToCart()
.
Kind: global class
The position of the product this variant belongs to inside the deal
Kind: instance property of
Variant ID
Kind: instance property of
Variant quantity
Kind: instance property of
Kind: global class
Image height in pixels, can be null if unknown.
Image width in pixels, can be null if unknown.
Image URL, similar to the src property of the img
tag.
Image alt value, similar to the alt property of the img
tag.
The position of this image inside the list of product images. Null if not applicable. Note: positions are 1-based.
Kind: global class
number
Option ID on Shopify. Unique across all option objects on Shopify.
string
Option name, e.g. Color
, Size
, etc.
number
The position of this option in the list of product options. Determines the option alias, e.g. if the position is 2, this option will be referred to as option2 in various API objects. Note: positions are 1-based.
Array.<string>
The list of of option values as on Shopify. For example, option Color
may have values: Red
, Green
, Blue
.
string
Swatch mode determines which widget is used to render this option. Possible values are dropdown
(default), buttons
, colors
. "Dropdown" is the default, renders a simple dropdown menu with option values. "Buttons" shows option values as clickable buttons. "Colors" shows option values as clickable color badges (requires additional settings in swatchValues
). Option swatch mode applies to all widget types.
object
Optional configuration for swatch modes. Currently only used when swatchValue
is colors
. In this case, will contain a map of color names (as in option values) and their corresponding color codes, e.g. { "Gold": "#FFC0CB", "Silver": "#8B4513" }
.
A restriction on product option values, as defined by the merchant in PickyStory admin. This can be used to prevent certain values from being selected by customers, or for hiding certain options entirely. Additionally, a restriction may simply define the initial option value when displaying it in a widget.
Kind: global class
string
Restriction mode, one of none
(default), locked
, hidden
. Falsy values are interpreted as none
mode.
string
Option value governed by this restriction.
Map of option restrictions for this product.
Kind: global class
Kind: global class
number
Variant ID on Shopify. Unique across all variant objects on Shopify.
string
Variant title, typically a combination of the option values such as Red / Large / Cotton
.
string
string
string
float
number
string
Kind: global class
number
Product ID on Shopify. Unique across all product objects on Shopify.
string
Product handle, unique in the scope of a single store. Typically a slug-like string, e.g. summer-t-shirt
. Handles are part of the product page URL on Shopify, e.g. /products/summer-t-shirt
.
string
Product title as displayed to customers.
number
The position of this product in the list of deal products. Serves as the main identifier of this product when providing option selections to add deal products to cart (see {ProductSelection}). Note: positions are 1-based.
string
Full description of this product. Often contains HTML.
The featured (default) image for this product
Map of option restrictions for this product.
Return the variant matching the specified option values
option1
option2
option3
Return the variant with the specified ID
variantId
Base class for all deals, provides common properties such as ID and category.
Kind: global class
Convert a list of ProductSelection
objects to corresponding Variant
objects.
selections
Get a Variant
object matching the desired ID by looking up in the products of this deal. If the variant is not found, false
is returned.
variantId
number
| *
selections
Combination of product option values comprising a selection of a specific variant. Provided for reference.
Kind: global class
Bundle deal.
Kind: global class
float
Return the discount value of this deal in the default store currency.
string
Return the discount type for this deal.
Promise.<*>
Add the deal to cart by providing a list of specific product variant for each deal product.
variants
selected variants, by product position in the deal
quantity
number
1
deal quantity - how many full deal instances to add, each one containing the specified variants
Builder deal.
Kind: global class
float
Return the discount value of this deal in the default store currency.
string
Return the discount type for this deal.
Kit - not implemented in 1.0.2.
Kind: global class
Look - not implemented in 1.0.2.
Kind: global class
Combo deal.
Kind: global class
float
Return the discount value of this deal in the default store currency.
string
Return the discount type for this deal.
Return the container Product
of this combo. The container is an actual product in the Shopify catalog that serves as the placeholder for this combo. When adding to cart, it is replaced by the individual products assigned to this combo. This property is unique to combos.
Boolean
Return true if the provided selections are valid for this {Combo}
selections
objects compatible with
Convert a list of {ProductSelection} objects to corresponding {Variant} objects.
selections
Promise.<*>
Add to cart variants matching the specified product option selections.
selections
objects containing at least
quantity
how many combo instances to add, e.g. if the quantity is 3 each of the variants will have 3 instances in cart
Promise.<*>
Add the specified variants to cart.
variants
objects with an optional {properties} field, see https://shopify.dev/api/ajax/reference/cart#add-line-item-properties.
quantity
1
how many combo instances to add, e.g. if the quantity is 3 each of the variants will have 3 instances in cart
Select option value shared by one or more products in the combo. "Single selection" must already be enabled and configured for the combo.
name
option name as on Shopify, e.g. "Color"
value
the desired option value, e.g. "Green"
Location
Kind: global class
boolean
True if this location is active on the current page/URL.
Main API client for PickyStory Browser API.
Kind: global class
Array.<string>
List the supported location categories.
Get locations in a specific category.
category
the desired location category
onlyActive
true
true to restrict the output locations to those active on the current page
*
Create Shopify line item objects based on the specified variant objects
Kind: global function
variants
selected variants, by product position in the deal
dealQuantity
number
deal quantity
Product image. See .
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Product option. See .
⇒ number
⇒ string
⇒ number
⇒ Array.<string>
⇒ string
⇒ object
Kind: instance property of
Kind: instance property of
Returns: string
- name
Kind: instance property of
Returns: number
- position
Kind: instance property of
Returns: Array.<string>
- values
Kind: instance property of
Kind: instance property of
⇒ string
⇒ string
Kind: instance property of
Kind: instance property of
⇒
⇒
⇒
Kind: instance property of
Kind: instance property of
Kind: instance property of
Product variant. See .
⇒ number
⇒ string
⇒ string
⇒ string
⇒ string
⇒ float
⇒
⇒ number
⇒ string
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Product object. See .
⇒ number
⇒ string
⇒ string
⇒ number
⇒ string
⇒
⇒
⇒
⇒
⇒
⇒
⇒
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Returns: number
- position
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance property of
Kind: instance method of
Kind: instance method of
⇒
⇒ | Boolean
⇒ number
| *
Kind: instance method of
Kind: instance method of
Kind: instance method of
⇒ float
⇒ string
⇒ Promise.<*>
Kind: instance property of
Kind: instance property of
Returns: string
- one of percentage
, fixedAmount
, fixedTargetPrice
Kind: instance method of
⇒ float
⇒ string
Kind: instance property of
Kind: instance property of
Returns: string
- one of percentage
, fixedAmount
, fixedTargetPrice
⇒ float
⇒ string
⇒
⇒ Boolean
⇒
⇒ Promise.<*>
⇒ Promise.<*>
Kind: instance property of
Kind: instance property of
Returns: string
- one of percentage
, fixedAmount
, fixedTargetPrice
Kind: instance property of
Kind: instance method of
Returns: Boolean
- valid or not
Kind: instance method of
Kind: instance method of
Kind: instance method of
Returns: Promise.<*>
- when the API operation is completed
Kind: instance method of
⇒ | | | |
⇒ boolean
Kind: instance property of
Kind: instance property of
⇒ Array.<string>
⇒
Kind: instance property of
Kind: instance method of