Alokai
You are reading the documentation for SDK v2, which is no longer the latest version. Switch to current

applyCartCoupon

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

Signature

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

Parameters

NameRequiredTypeDescription
contextRequiredSetupContextAutomatically injected context. Refer to SetupContext
paramsRequiredApplyCartCouponParamsCart information
discountCodeRequiredstringDiscount (coupon) code
customQueryOptionalCustomQueryCustom queries included in the request
responseOptionsOptionalResponseOptions

Returns

User cart information

Referenced Types

On this page