Home > @vsf-enterprise/commercetools-api > getCart

# getCart() function

Warning: This API is now obsolete.

Starting from version 1.7.2 use the getMe endpoint

Endpoint for loading cart of the currently logged user. By default, it uses the getCartDefaultQuery GraphQL query

Signature:

export declare function getCart(context: Context, cartId: string, customQuery?: CustomQuery): Promise<GetCartResponse>;

# Parameters

Parameter Type Description
context Context Automatically injected context. Refer to Context
cartId string Cart ID
customQuery CustomQuery Custom Query

Returns:

Promise<GetCartResponse>

Cart data