Discount Codes

Let customers enter a Stripe promotion code on your web paywall, update the price in place, and carry the discount through to Stripe checkout.

Discount codes let a customer type a promotion code into your web paywall, have it validated against Stripe, and see the price update before they check out. The code is then carried through to the Stripe checkout session, so the discount is applied to the purchase they complete.

This works entirely on your paywall — there is no separate discount widget to configure. You add a normal text Input for the customer to type into, then a button whose tap behavior runs the Redeem Discount action. When the customer taps it, Superwall resolves the code against your Stripe promotion codes, re-prices the products on the paywall, and applies the code at checkout.

Discount codes are a Stripe web checkout feature. The customer redeems a promotion code you have already created in your Stripe dashboard — Superwall does not create or manage the coupon itself.

Before you start

Create the coupon and promotion code in Stripe first. Superwall resolves whatever the customer types against your existing Stripe promotion codes at redeem time, so the code has to exist before it can be applied.

  1. In your Stripe dashboard, create a coupon with the discount you want to offer (for example, 20% off, or a fixed amount off).
  2. Create a promotion code for that coupon. The promotion code is the customer-facing string a customer will type into your paywall (for example, LAUNCH20).

Make sure the promotion code exists in the same Stripe environment (live or sandbox) as the products on the paywall you are testing. A live promotion code will not resolve against a sandbox checkout, and vice versa.

Add discount code redemption to a paywall

You will add a text input for the customer to type into, then a button that redeems whatever they entered. Open the paywall you want to edit in the paywall editor and follow along.

  1. 1

    Add an input for the code

    Add an Input element where the customer will type their code, and give it a helpful placeholder such as "Promo code". Bind the input to a state variable — for example, state.discountCode — so the value the customer types is available to the redeem action.

  2. 2

    Add a button to redeem

    Add a button (or reuse an existing one) next to the input. This is the element the customer taps to apply their code.

  3. 3

    Add the Redeem Discount action

    Select the button and, under Tap Behavior, click + Add Action. In the Purchases group, choose Redeem Discount.

  4. 4

    Point the action at the code

    Set the action's code to reference the input's state variable using Liquid, for example {{ state.discountCode }}. This redeems whatever the customer typed.

    To offer a single fixed promotion instead of customer-entered codes, you can skip the input and set the code to a hardcoded literal such as LAUNCH20. Tapping the button then always applies that one code.

  5. 5

    Publish and test

    Publish the paywall, then enter a real promotion code to confirm the price updates and the discount carries through to checkout. See Testing purchases for how to run test checkouts safely.

What happens when a code is redeemed

When the customer taps the button, Superwall:

  1. Validates the code against your Stripe promotion codes.
  2. Re-prices the products on the paywall in place, so the customer sees the discounted price immediately.
  3. Forwards the code to the Stripe checkout session, so the discount is applied to the purchase they complete.

If the code is not valid, the products stay at their original price.

Showing the discounted price

After a code applies, discount display variables become available so your paywall can react to the discount and show the new price. You can insert these from the variable picker in a text element or wherever you use dynamic values, for example:

  • hasDiscount — whether a discount is currently applied. Use it to show or hide a "discount applied" message, a strikethrough of the original price, or a badge.
  • discountCode — the code that was applied.
  • discountedPrice — the price after the discount.

A common pattern is to show the original price with a strikethrough alongside discountedPrice once hasDiscount is true, so the savings are obvious before the customer checks out.

Where discount codes apply

A redeemed code carries through Superwall's web checkout flows — redirect, embedded, and elements checkout all apply it at the Stripe checkout session. The one exception is deferred Apple Pay checkout, which does not apply a redeemed discount code.

How is this guide?

On this page