Run a scheduled sale with promo codes
To run a time-boxed sale with BillDog, publish a sale paywall, then create a campaign under Engagement → Campaigns that serves it on your placement between a Start Date and an End Date. A Countdown component in the paywall builder shows the time left. For web checkout, create codes under Monetization → Promotion Codes; on iOS, BillDog.shared.presentCodeRedemptionSheet() opens Apple's offer-code sheet.
Steps last checked against the SDK source on 16 Nov 2026.
What you'll build
- A sale paywall that replaces your normal paywall on
onboardingfor a fixed window, then switches back by itself - A countdown to the end of the sale inside the paywall
- A Stripe promotion code customers can type at web checkout, or that your server applies for them
- An in-app button that opens the App Store offer-code sheet
What you'll need
- An app that shows a paywall from the
onboardingplacement (the iOS, Android, Flutter or React Native codelab) - For web promotion codes: Stripe connected and a product with a Stripe price (steps 1 and 2 of the headless web paywall codelab)
- For App Store promotional offers: your In-App Purchase key under Project Settings → Settings → Store Setup (App Store setup)
1. Decide where the discount comes from
3 minBillDog decides which paywall a user sees and when. It doesn't change store prices. The discount itself comes from each store, so set it up there first:
- App Store: an introductory offer (new subscribers) or a promotional offer on the subscription in App Store Connect. BillDog signs promotional offers with your In-App Purchase key. Apple has limited promotional offers to current and past subscribers, so check Apple's current eligibility rules before you aim one at new users.
- Google Play: an offer on the subscription's base plan in Play Console. Note its offer ID. Set its eligibility to developer determined and add the tag
bd-ignore-offer, so your normal paywall doesn't pick it up automatically. A tagged offer can still be pinned to the sale package. - Web (Stripe): a promotion code you create in BillDog (step 5), or a cheaper Stripe price on a separate product.
- Any store: a separate, cheaper product. It needs its own store product, so plan for review time.
2. Build the sale offering and paywall
12 min- Open Monetization → Offerings and click New Offering, for example
black_friday. Leave Mark as current offering off. Add the same products as your normal offering (or the sale products) with Add Product, then Save Changes. - In Paywalls & Funnels, duplicate the paywall your placement serves today. The copy is an inactive draft named "(Copy)". Open it and, in the Products panel (the box icon in the left rail), choose the
black_fridayoffering under Offering. - To sell a store offer, open a package's menu in the Products panel and click Edit preferred offer IDs. Fill in Preferred Play offer ID with the Play offer ID. It is saved on the offering's package, which is why the sale uses its own offering: your normal paywall keeps full price. For the App Store, click Settings in the left rail and type the promotional offer identifier into Promo Offer Identifier (iOS) under App Store Integration. Use that rather than the package's Preferred App Store promo offer ID: on iOS the package pin is missed when the same product is also in your current offering.
- Add a Countdown component from the component palette. Under Countdown Settings, set End Time to the moment the sale ends as an ISO date, for example
2026-11-30T23:59:59Z, and set Expired Text to something likeSale ended. - Change the headline and button copy, then click Publish (then Save & Publish). Check it shows Live under Paywalls & Funnels → All Paywalls.
Use a fixed ISO date for a sale. A relative End Time such as +1d counts from the moment the paywall opens, so every user sees a fresh full day.
3. Schedule it with a campaign
8 minA campaign serves a paywall on one or more placements, for an audience, inside a date window. Outside the window the placement serves its own linked offering again, so the sale ends without anyone touching it.
- Open Engagement → Campaigns and click New Campaign.
- Under Basic Info, enter a Campaign Name, choose Campaign Type: Promotional and Content Type: Paywall, then click Next. This saves a draft.
- Under Placements, click Add Placement and choose
onboardingfrom Available Placements. Click Next. - Under Audiences, click Add Audience. Enter an Audience Name, choose Paywall under Content Type, pick the sale paywall in Select Paywall and keep Allocation at 100%. Leave the conditions empty to include everyone, then click Create Audience and Next.
- Under Schedule, set Start Date and End Date. Click Next, check the Review step and click Save & Activate.
Dates are whole days in UTC: the campaign starts at 00:00 UTC on the start date and ends at 23:59:59 UTC on the end date. Match the countdown's End Time to that, or pick dates that fit your time zone.
Only one active campaign can use a placement at a time (default campaigns aside), and the dates don't change that. If another active campaign already owns onboarding, the placement shows Used by active campaign and activation is refused. Pause the other campaign or use a different placement.
To test before launch, set the Start Date to today, switch the dashboard header to Sandbox and open the placement on a test device. Your app code doesn't change: register returns the campaign's paywall while it runs.
4. Create a promotion code for web checkout
6 minPromotion codes discount BillDog web checkout (Stripe). They live in your own Stripe account, in the mode your Stripe key is in. App Store and Google Play purchases use the stores' own offer codes (step 7).
- Open Monetization → Promotion Codes and click Create Coupon.
- In Create Promotion Code, enter a Name (shown in Stripe and on this page) and a Promotion Code such as
BLACKFRIDAY30. That is what customers type. Leave it empty for a coupon only your server can apply. - Choose a Discount Type: Percentage with Percentage Off, or Fixed Amount with Amount Off and a Currency (it only applies to checkouts in that currency).
- Choose a Duration: Once (first payment only), Multiple months (then Duration in Months) or Forever (all payments).
- Optionally set Max Redemptions and a Last Day. The code works until the end of that day in your time zone. Set it to the last day of the sale.
- Click Create Coupon.
Customers can only type a code if Stripe Checkout shows the field. Turn on Customers can enter promotion codes on web checkout under Code entry at checkout on the same page. That project default applies to in-app web checkouts and web SDK checkouts. A placement's hosted checkout page can override it on the placement's Web tab (Promotion code field).
Codes you made in the Stripe dashboard appear after you click Sync with Stripe. The page also shows redemptions: Checkouts with a code, Discounts given and Revenue with a code.
5. Apply a code from your server
5 minTo give a sale price without asking the buyer to type anything, start the checkout from your server with a secret key and name the code. The code is matched case-insensitively against active codes in BillDog. The answer's data.url is the Stripe Checkout page to redirect the buyer to.
curl -X POST https://api.billdog.io/v1/create-web-checkout \
-H "X-BillDog-API-Key: bd_secret_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"source": "web_paywall",
"product_id": "premium_monthly",
"app_user_id": "user_123",
"promotion_code": "BLACKFRIDAY30",
"success_url": "https://example.com/thanks",
"cancel_url": "https://example.com/pricing"
}'product_idis the product's Product Identifier (its BillDog ID or Stripe price ID also work).- Send
coupon_id(the BillDog coupon ID) instead ofpromotion_codefor a coupon with no code. Send one or the other, not both. - With a code applied, Stripe hides the code field, so don't also send
allow_promotion_codes: true. That's refused. - A public key can't apply codes: the server answers
403 ACCESS_DENIEDwith reasonserver_only. - An expired or wrong-mode code is refused with
400and reasoncoupon_expiredorcoupon_wrong_mode; an unknown or deactivated code with404. (coupon_inactiveis the reason for a deactivatedcoupon_id.)
6. Let users redeem store offer codes
5 minApp Store offer codes are created in App Store Connect and redeemed through Apple's own sheet. On iOS, presentCodeRedemptionSheet() opens it. It runs on the main actor and throws if there is no window scene to present in.
import SwiftUI
import BillDogFull
struct RedeemCodeButton: View {
var body: some View {
Button("Redeem a code") {
Task {
do {
try await BillDog.shared.presentCodeRedemptionSheet()
} catch {
print("Could not open the code sheet: \(error)")
}
}
}
}
}The redeemed subscription arrives as a StoreKit transaction outside your purchase flow. The SDK listens for those and records them, so the entitlement follows. Refresh with getCustomerInfo(forceRefresh: true) after the sheet closes if you show the plan on screen.
Google Play promo codes are redeemed in the Play Store app, not in yours, and the Android SDK has no call for them. When the purchase reaches your app's billing listener, the SDK records it like any other. Set up Play's real-time notifications (Google Play setup) so the server hears about it even before the app opens.