Pre-populating promo codes in Wix checkout

Is there any way to pre-populate a Wix checkout page with a promo code? Whether it’s through a marketing email or a QR code etc. is there way to inject the promo code into the URL so that it is pre populated upon arrival at the checkout page?

Wix Editor, Wix Studio Editor

You can accomplish this by using query parameters in order to inject a coupon code to the cart url.

Using the Cart Page Code, you can detect a “coupon” query parameter then use the applyCoupon() method to set it to the user’s cart automatically if found.