---
title: Testing win-back offers in Xcode
framework: storekit
role: article
role_heading: Article
path: storekit/testing-win-back-offers-in-xcode
---

# Testing win-back offers in Xcode

Validate your app’s handling of win-back offers that you configure for the testing environment.

## Overview

Overview A win-back offer is an offer for a discount on an auto-renewable subscription to a customer who was previously subscribed. To test win-back offers in Xcode, first set up your StoreKit configuration file with auto-renewable subscriptions and win-back offers. Subscribe to an auto-renewable subscription with one or more win-back offers. Then, cancel the subscription and allow it to expire. If the win-back offer’s setting is Eligible, the testing system makes the win-back offer available to redeem immediately after the subscription expires. Testing win-back offers in Xcode is convenient early in the development process, because it doesn’t rely on any product configurations in App Store Connect. However, you can also test win-back offers in the sandbox environment, which does rely on your App Store Connect configuration. For more information, see Testing win-back offers in the sandbox environment. Perform basic setup Before you can begin testing in Xcode, complete the steps in Setting up StoreKit Testing in Xcode, including creating a StoreKit configuration file and enabling StoreKit testing in Xcode. Configure win-back offers for testing Start by opening the StoreKit configuration editor in Xcode and defining at least one auto-renewable subscription and subscription group. Then follow these steps to configure one or more win-back offers: In the left pane, select the subscription under the Auto-Renewable Subscriptions heading. Under the Win-back Offers heading in the editor, click the Add button (+) to configure a new offer by filling out the offer details as follows, and then clicking Save. note: The eligibility criteria that determine whether a customer can redeem a win-back offer can have many rules and states. Rather than requiring you to construct all the conditions before you can test win-back offers in your app, the testing UI provides a simplified Eligible or Not Eligible setting that bypasses any other eligibility criteria. Set the value to Eligible to test your app’s response when a customer receives a win-back offer. Run the test To display a win-back offer, run your app in the Xcode environment and follow these steps: In your app, subscribe to an auto-renewable subscription that has at least one win-back offer. In the StoreKit configuration, set the Eligibility setting for the win-back offer to Eligible. Cancel the subscription. If your app implements subscription management, such as by calling showManageSubscriptions(in:), cancel the subscription through your app. Otherwise, use the transaction manager in Xcode by choosing Debug > StoreKit > Manage Transactions, selecting the subscription transaction, and turning off the auto-renew option. Wait for the canceled subscription to expire. The system makes the win-back offer available to redeem as soon as the subscription expires. In your app, open your store. Examine your app’s implementation of the win-back offer. For example, if your app uses StoreKit views, the eligible offers appear automatically when your app displays a SubscriptionStoreView. For more information about using the transaction manager, see Testing in-app purchases with StoreKit transaction manager in Xcode. Reset or rerun the test You can rerun the test without resetting any state values. Win-back offers that you set to be Eligible appear as soon as their related subscriptions expire.

## See Also

### In-App Purchase Testing

- [Testing at all stages of development with Xcode and the sandbox](storekit/testing-at-all-stages-of-development-with-xcode-and-the-sandbox.md)
- [Testing In-App Purchases with sandbox](storekit/testing-in-app-purchases-with-sandbox.md)
- [Testing refund requests](storekit/testing-refund-requests.md)
- [Testing Ask to Buy in Xcode](storekit/testing-ask-to-buy-in-xcode.md)
