Make purchases in mobile app in iOS SDK
Displaying paywalls within your mobile app is an essential step in offering users access to premium content or services. However, simply presenting these paywalls is enough to support purchases only if you use Paywall Builder to customize your paywalls.
If you don’t use the Paywall Builder, you must use a separate method called .makePurchase() to complete a purchase and unlock the desired content. This method serves as the gateway for users to engage with the paywalls and proceed with their desired transactions.
If your paywall has an active promotional offer for the product a user is trying to buy, Adapty will automatically apply it at the time of purchase.
Keep in mind that the introductory offer will be applied automatically only if you use the paywalls set up using the Paywall Builder.
In other cases, you’ll need to verify the user’s eligibility for an introductory offer on iOS. Skipping this step may result in your app being rejected during release. Moreover, it could lead to charging the full price to users who are eligible for an introductory offer.
Make sure you’ve done the initial configuration without skipping a single step. Without it, we can’t validate purchases.
Make purchase
Using Paywall Builder? Purchases are processed automatically—you can skip this step.
Looking for step-by-step guidance? Check out the quickstart guide for end-to-end implementation instructions with full context.
Request parameters:
| Parameter | Presence | Description |
|---|---|---|
| Product | required | An AdaptyPaywallProduct object retrieved from the paywall. |
Response parameters:
| Parameter | Description |
|---|---|
| Profile | If the request has been successful, the response contains this object. An AdaptyProfile object provides comprehensive information about a user’s access levels, subscriptions, and non-subscription purchases within the app. Check the access level status to ascertain whether the user has the required access to the app. |
Note: if you’re still on Apple’s StoreKit version lower than v2.0 and Adapty SDK version lower than v.2.9.0, you need to provide Apple App Store shared secret instead. This method is currently deprecated by Apple.
In-app purchases from the App Store
When a user initiates a purchase in the App Store and the transaction carries over to your app, you have two options:
- Process the transaction immediately: Return
trueinshouldAddStorePayment. This will trigger the Apple purchase system screen right away. - Store the product object for later processing: Return
falseinshouldAddStorePayment, then callmakePurchasewith the stored product later. This may be useful if you need to show something custom to your user before triggering a purchase.
Here’s the complete snippet:
final class YourAdaptyDelegateImplementation: AdaptyDelegate {
nonisolated func shouldAddStorePayment(for product: AdaptyDeferredProduct) -> Bool {
// 1a.
// Return `true` to continue the transaction in your app. The Apple purchase system screen will show automatically.
// 1b.
// Store the product object and return `false` to defer or cancel the transaction.
false
}
// 2. Continue the deferred purchase later on by passing the product to `makePurchase` when the timing is appropriate
func continueDeferredPurchase() async {
let storedProduct: AdaptyDeferredProduct = // get the product object from 1b.
do {
try await Adapty.makePurchase(product: storedProduct)
} catch {
// handle the error
}
}
}
Redeem offer codes in iOS
About offer codes
Offer codes allow you to give discounts or free trials to specific users. Unlike regular offers that are applied automatically, offer codes are distributed outside the app — through email campaigns, social media, or printed materials. Users redeem them by entering the code in the App Store, following a redemption URL, or through an in-app dialog.
To set up offer codes, open a subscription in App Store Connect and go to its Offer Codes section. You can create three kinds of offer codes:
- Free — the subscription is free for a set duration, and the next renewal is at full price.
- Pay as you go — the user pays a discounted price each billing cycle for a set duration, then the subscription renews at full price.
- Pay up front — the user pays a single discounted price for the entire offer duration, then the subscription renews at full price.
You don’t need to add offer codes to Adapty. Apple tags every transaction during the offer period with the offer code category. This includes the initial redemption and all subsequent discounted renewals. Adapty detects the tag and records each transaction with the offer category offer_code. Once the offer period ends and the subscription renews at full price, the tag is no longer present. You can filter analytics by the Offer Code offer type in the Adapty Dashboard.
Revenue discrepancy troubleshooting
If you notice that an offer code transaction appears in Adapty at the full product price instead of the discounted offer price, verify the following in App Store Connect:
- The offer code has the correct pricing configured for all regions where users can redeem it.
- The offer price is set for the specific country or region of the user. Apple sends the regional price in the transaction. If no regional price is configured for the offer, Apple may send the full product price instead.
You can filter and verify offer code transactions in the Adapty Dashboard by the Offer Code offer type and Offer Discount Type filters.
Legacy promo codes (deprecated)
Apple deprecated promo codes for in-app purchases in March 2026. Offer codes replace them with more capabilities: configurable eligibility, expiration dates, and up to 1 million codes per quarter. If you previously used promo codes for in-app purchases, transition to offer codes in App Store Connect.
Legacy promo codes (limited to 100 per app per version) granted free access to a subscription. Unlike offer codes, Apple did not include discount information in promo code transactions — it sent the full product price in the receipt. As a result, Adapty recorded these transactions at the full price, which caused revenue discrepancies between Adapty analytics and App Store Connect.
If you see historical transactions at full price that should have been free, they are likely from legacy promo codes. Since these codes are now deprecated, transition to offer codes for accurate revenue tracking.
To display the code redemption sheet in your app:
Adapty.presentCodeRedemptionSheet()
Based on our observations, the Offer Code Redemption sheet in some apps may not work reliably. We recommend redirecting the user directly to the App Store.
In order to do this, you need to open the url of the following format:
https://apps.apple.com/redeem?ctx=offercodes&id={apple_app_id}&code={code}