getVariants( )


Gets a product's available variants based on the specified product ID and either option choices or variant IDs.

Method Declaration
Copy
Method Parameters
productIdstringRequired

ID of the product whose variants are being retrieved. Pass only this field to retrieve all of the specified product's variants.


optionsProductVariantOptions

Variant options to return. If not specified, all the product's variants are returned.

Returns
Return Type:Promise<Array<VariantItem>>
Did this help?