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

CartsApi.getCarts() method

Lists all customer carts. Get all customer carts.

Signature:

getCarts(baseSiteId: string, userId: string, currentPage?: number, fields?: 'BASIC' | 'DEFAULT' | 'FULL', pageSize?: number, savedCartsOnly?: boolean, sort?: string, options?: any): Promise<import("axios").AxiosResponse<CartList>>;

Parameters

Parameter Type Description
baseSiteId string Base site identifier
userId string User identifier or one of the literals : &#39;current&#39; for currently authenticated user, &#39;anonymous&#39; for anonymous user
currentPage number Optional pagination parameter in case of savedCartsOnly &#x3D;&#x3D; true. Default value 0.
fields 'BASIC' | 'DEFAULT' | 'FULL' Response configuration. This is the list of fields that should be returned in the response body.
pageSize number Optional parameter in case of savedCartsOnly &#x3D;&#x3D; true. Default value 20.
savedCartsOnly boolean Optional parameter. If the parameter is provided and its value is true, only saved carts are returned.
sort string Optional sort criterion in case of savedCartsOnly &#x3D;&#x3D; true. No default value.
options any Override http request option.

Returns:

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

Exceptions

{RequiredError} CartsApi