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
| Name | Required | Type | Description |
|---|---|---|---|
context | Required | SetupContext | Automatically injected context. Refer to SetupContext |
params | Required | ApplyCartCouponParams | Cart information |
discountCode | Required | string | Discount (coupon) code |
customQuery | Optional | CustomQuery | Custom queries included in the request |
responseOptions | Optional | ResponseOptions |
Returns
User cart information