createCustomerProductList
Creates a customer product list. Works for both registered and guest customers.
This method communicates with the createCustomerProductList endpoint of the Vue Storefront API Middleware. In turn, it receives data from the createCustomerProductList or the Create customer product list endpoints exposed by SCAPI / OCAPI depending on the middleware configuration.
The following types of product lists are available: - wish_list - gift_registry - shopping_list - custom_1 - custom_2 - custom_3
Signature
export declare function createCustomerProductList(
params: CreateCustomerProductListParams
): Promise<CustomerProductList>;Parameters
| Name | Required | Type | Description |
|---|---|---|---|
params | Required | CreateCustomerProductListParams |
Returns
Returns a representation of a Product List.
Referenced Types
CreateCustomerProductListParamsCustomerProductList
Examples
Creating an empty wishlist for the current customer.
import { sdk } from '~/sdk.config.ts';
const customer = await sdk.commerce.createCustomerProductList({
type: 'wish_list'
});Creating a custom product list with an item for the current customer.
import { sdk } from '~/sdk.config.ts';
const customer = await sdk.commerce.createCustomerProductList({
type: 'custom_1',
customerProductListItems: [{
productId: '123456',
}],
});