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

# createCart() function

Endpoint for creating a new cart for the current user. By default, it uses the createCartDefaultQuery GraphQL query

Signature:

export declare function createCart(context: Context, cartDraft?: CreateCartParams, customQuery?: CustomQuery): Promise<CreateCartResponse>;

# Parameters

Parameter Type Description
context Context Automatically injected context. Refer to Context
cartDraft CreateCartParams Cart information
customQuery CustomQuery Custom queries included in the request

Returns:

Promise<CreateCartResponse>

User cart information