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 : 'current' for currently authenticated user, 'anonymous' for anonymous user |
currentPage | number | Optional pagination parameter in case of savedCartsOnly == 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 == 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 == true. No default value. |
options | any | Override http request option. |
Returns:
Promise<import("axios").AxiosResponse<CartList>>
Exceptions
{RequiredError} CartsApi