Home > @vue-storefront/magento-api > applyCouponToCart

applyCouponToCart() function

Applies a coupon to a given card

Signature:

export default function applyCouponToCart(context: Context, input: ApplyCouponToCartInput, customQuery?: CustomQuery, customHeaders?: CustomHeaders): Promise<FetchResult<ApplyCouponToCartMutation>>;

Parameters

Parameter Type Description
context Context VSF context
input ApplyCouponToCartInput ID of the card and coupon to apply
customQuery CustomQuery (Optional) custom GraphQL query that extends the default one
customHeaders CustomHeaders (Optional) (optional) - custom headers that extends the default headers

Returns:

Promise<FetchResult<ApplyCouponToCartMutation>>