Home > @vsf-enterprise/sap-commerce-webservices-sdk > CartsApi > createCartEntry

CartsApi.createCartEntry() method

Adds a product to the cart. Adds a product to the cart.

Signature:

createCartEntry(baseSiteId: string, cartId: string, userId: string, entry: OrderEntry, fields?: 'BASIC' | 'DEFAULT' | 'FULL', options?: any): Promise<import("axios").AxiosResponse<CartModification>>;

Parameters

Parameter Type Description
baseSiteId string Base site identifier
cartId string Cart identifier: cart code for logged in user, cart guid for anonymous user, &#39;current&#39; for the last modified cart
userId string User identifier or one of the literals : &#39;current&#39; for currently authenticated user, &#39;anonymous&#39; for anonymous user
entry OrderEntry Request body parameter that contains details such as the product code (product.code), the quantity of product (quantity), and the pickup store name (deliveryPointOfService.name). The DTO is in XML or .json format.
fields 'BASIC' | 'DEFAULT' | 'FULL' Response configuration. This is the list of fields that should be returned in the response body.
options any Override http request option.

Returns:

Promise<import("axios").AxiosResponse<CartModification>>

Exceptions

{RequiredError} CartsApi