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:
について catalogReference
object includes the following fields:
eコマース | Stores Catalog |
---|---|
catalogItemId | について 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 |
1
options
または customTextFields
based on the modifierRenderType
:
TEXT_CHOICES
, use the modifier and choice key in options
.FREE_TEXT
, use the freeTextSettings.key
in customTextFields
.customTextFields
そして options
in catalogReference
if the related modifier is not mandatory.subscriptionOptionId
if the product doesn't have subscriptionDetails
defined or when subscriptionDetails.allowOneTimePurchases
is 真の
.variantId
.Consider a product with the following structure:
1
Note: many product fields in the above example have been omitted for conciseness.
A buyer wants to purchase "Coffee" with the following options:
catalogReference
object1
To find the correct variantId
, match the options.id
そして options.choicesSettings.choices.choiceId
of
the buyer's selected options with variantsInfo.variants.optionChoiceIds.optionId
そして
variantsInfo.variants.optionChoiceIds.optionId
in the variants.
catalogReference
objectSince both modifiers have "mandatory": false
そして subscriptionDetails.allowOneTimePurchases
is 真の
, the following minimal catalogReference
is also valid:
1