Questions on Promo/Offer Code Validation and Functionality for In-App Purchases

We are implementing promo/offer codes for our iOS app’s subscription in-app purchases and have several technical questions regarding validation, receipt data, and integration. Could you please provide guidance on the following points?

  1. Testing/Validating Custom Codes Without Production Release: How can we validate custom promo/offer codes in a non-production environment? Current documentation indicates promo codes only work in production, requiring app submission and future release date setup for testing.
  2. Receipt Data for Redeemed Codes: The receipt currently includes only offer_code_ref_name, not the exact redeemed code (e.g., “ABC123”) entered by the user. Is there a way to retrieve the specific offer code used via receipts, App Store Server API, or other endpoints?
  3. Server-Side Validation Best Practices: What are the recommended best practices for server-side validation of offer codes, including using App Store Server API for transaction verification?
  4. Passing appAccountToken for Coupons: How can we pass an appAccountToken when users redeem coupon/offer codes (e.g., via presentOfferCodeRedeemSheet or redemption flows)? StoreKit purchase options support it for regular purchases but not redemption sheets.
  5. Callbacks on Coupon Redemption: Is there a client-side callback or notification (e.g., via updatedTransactions or StoreKit observers) when a user successfully redeems a coupon code in the app? Server notifications are received, but app-side feedback appears unreliable.

Hello,

You can find most of the answers and details to your points by going through the Supporting offer codes in your app article, but let me give you a summary to your specific questions:

  1. You can test offer codes in the sandbox environment for all In-App Purchase product types: consumable, non-consumable, non-renewing subscription, and auto-renewable subscription.

To redeem an offer code in the sandbox environment, follow these steps:

  • On your device, sign in using a Sandbox Apple Account.
  • On the Sandbox Account Settings page, tap Initiate Transaction.
  • Select Offer Codes and redeem a sandbox offer code you created in App Store Connect.
  1. You can use the information contained in the transaction to identify products purchased with offer codes, you need to check the offer property of Transaction on StoreKit, or the offerIdentifier if you're using the App Store Server API or notifications.

  2. If you're not using it yet, we highly recommend using the App Store Server libraries to adopt the App Store Server API.

  3. To provide an app account token for a transaction that the customer completes outside of your app, or to update the value of an existing app account token, call the Set App Account Token endpoint.

  4. You can check currentEntitlements and unfinished on Transaction to get any transactions that may have occurred while the app wasn’t running. And make sure to support offer codes redeemed outside of your app.

I hope this helps out!

Questions on Promo/Offer Code Validation and Functionality for In-App Purchases
 
 
Q