How can I test redeeming an offer code?
Asked on 2024-07-30
1 search
To test redeeming an offer code, you can use StoreKit testing in Xcode. This is the quickest way to test offers while developing your app. Here are the steps you can follow:
-
Configure Winback Offers in Xcode:
- Open the StoreKit configuration where you have set up your local and app purchases.
- Find your subscription under the auto-renewable subscriptions heading.
- Scroll down to the Winback offers section to configure the offers.
-
Test Different Scenarios:
- Use the customer eligibility toggle to decide if you should receive the Winback offer in your app when you churn from a subscription.
- Change the eligibility while debugging to test different scenarios of the customer's offer eligibility.
-
Use StoreKit Testing in Xcode:
- Test your purchase intent, listener, and deferral logic.
- Add the selected offer to the purchase options in Xcode 16.
For more detailed steps, you can refer to the session Implement App Store Offers (28:02).
If you need to test promotional offers, you can also use the App Store server library to create a promotional offer signature and ensure that the offer is only redeemed the number of times you specify. For more information on this, you can refer to the session Explore App Store server APIs for In-App Purchase (21:25).
Relevant Sessions

Explore App Store server APIs for In-App Purchase
Learn how to leverage your server to build great In-App Purchase experiences with the latest updates to the App Store Server API, App Store Server Notifications, and the open source App Store Server Library. After a recap of current APIs, we’ll introduce updated endpoint functionality, new transaction fields, and a new notification type. We’ll also discuss best practices for the purchase lifecycle, delivering content, and targeting offers, so you can become a server power user.

Implement App Store Offers
Learn how to engage customers with App Store Offers using App Store Connect, as well as the latest StoreKit features and APIs. Discover how you can set up win-back offers (a new way to re-engage previous subscribers) and generate offer codes for Mac apps. And find out how to test offers in sandbox and Xcode to make sure they work smoothly.
