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

# applyCartCoupon() function

Endpoint for applying discount code to the provided cart. By default, it uses the updateCartDefaultQuery GraphQL query

Signature:

export declare function applyCartCoupon(context: Context, params: ApplyCartCouponParams, discountCode: string, customQuery?: CustomQuery): Promise<ApplyCartCouponResponse>;

# Parameters

Parameter Type Description
context Context Automatically injected context. Refer to Context
params ApplyCartCouponParams Cart information
discountCode string Discount (coupon) code
customQuery CustomQuery Custom queries included in the request

Returns:

Promise<ApplyCartCouponResponse>

User cart information