When integrating products from your Wix Stores catalog into an eCommerce cart, checkout, or order, you must use the catalogReference
object structure.
This guide explains how to properly format and use the catalogReference
object in various eCommerce API functions.
Pass the catalogReference
object as part of the lineItems
array in the following eCommerce API functions:
The catalogReference
object includes the following fields:
eCommerce | Stores Catalog |
---|---|
catalogItemId | The productId of the Wix Stores product |
appId | The Wix Stores app ID (always "215238eb-22a5-4c36-9e7b-e7c08025e04e" ) |
options | An optional object containing product-specific key-value pairs |
options
or customTextFields
based on the modifierRenderType
:
TEXT_CHOICES
, use the modifier and choice key in options
.FREE_TEXT
, use the freeTextSettings.key
in customTextFields
.customTextFields
and options
in catalogReference
if the related modifier is not mandatory.subscriptionOptionId
if the product doesn't have subscriptionDetails
defined or when subscriptionDetails.allowOneTimePurchases
is true
.variantId
.Consider a product with the following structure:
Note: many product fields in the above example have been omitted for conciseness.
A buyer wants to purchase "Coffee" with the following options:
catalogReference
objectTo find the correct variantId
, match the options.id
and options.choicesSettings.choices.choiceId
of
the buyer's selected options with variantsInfo.variants.optionChoiceIds.optionId
and
variantsInfo.variants.optionChoiceIds.optionId
in the variants.
catalogReference
objectSince both modifiers have "mandatory": false
and subscriptionDetails.allowOneTimePurchases
is true
, the following minimal catalogReference
is also valid: