applyDiscountToCheckout( )


Applies a discount to a checkout.

You can apply one of the following discounts, which are exchanged for loyalty points: reward, loyaltyCoupon, or referralReward.

Method Declaration
Copy
function applyDiscountToCheckout(
  checkoutId: string,
  options: ApplyDiscountToCheckoutOptions,
): Promise<ApplyDiscountToCheckoutResponse>;
Method Parameters
checkoutIdstringRequired

ID of the checkout to apply the discount to.


optionsApplyDiscountToCheckoutOptions
Returns
Return Type:Promise<ApplyDiscountToCheckoutResponse>
JavaScript
import { checkoutExchange } from "@wix/loyalty"; async function applyDiscountToCheckout(checkoutId, options) { const response = await checkoutExchange.applyDiscountToCheckout( checkoutId, options, ); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?