Build With RevenueCat

Build a customized mobile subscription business with RevenueCat. We do the heavy lifting of normalizing subscribers from any source and maintain a single source of truth for subscription status, so you can get back to building your app.

RevenueCat is a powerful, secure, reliable, and free to use in-app purchase server with global support. All you need to get started is an API key.

Get Started    REST API Endpoints

Non-Subscription Purchases

Using RevenueCat beyond subscriptions

Although RevenueCat is commonly used to handle complex subscription logic, all types of purchases, including consumables, are tracked by the Purchases SDK. This makes it easy to use RevenueCat’s powerful revenue reporting features to track all of the purchases your app supports.

There are a few things to note while using non-subscription IAP's with RevenueCat's Offerings and Entitlements features.

Definitions

Consumable In-App Purchase: a purchase that unlocks content that can be 'consumed', for example coins or gems in a game.

Non-consumable IAP: a purchase that permanently unlocks content, for example unlocking a specific coloring book in a coloring app.

Non-renewing subscriptions: a purchase that unlocks content for a specific period of time. For example, unlocking access to a magazine for 1 month, after which the subscription will not be renewed.

Entitlements

Entitlements are used to unlock access to content after a user purchases a product tied to a specific entitlement. This means: if you add a consumable product to an entitlement, RevenueCat will report that entitlement as unlocked (forever), even after one purchase. This is because there is no expiration date for consumables, like there is for a subscription. This may work for some use-cases, but generally, you wouldn't add a consumable product to an entitlement meant to be unlocked by a subscription.

📘

It's important to note that even if consumables aren't attached to an entitlement, they can still be purchased the same way as other offerings and packages. This will allow you to take advantage of RevenueCat's powerful revenue reporting features.

If you wanted to add a 'Lifetime Unlock' purchase option to your app, it is recommended to create a new non-consumable IAP, add the product to your offering, and add the product to your entitlement. This works well in many contexts, such as alongside other subscription packages, or just as a standalone package in your offering.

For more information, read our guide on Entitlements.

Offerings

Offerings are typically associated with different subscription options, but they can be used to display any kind of in-app purchase.

Example

Let's say we are building a game where we can offer multiple coin packages. First, we need to create a new offering called "coins". Go to your app's page in the RevenueCat dashboard, click the Offerings tab, and click the + to add a new offering.

Great! Click 'Add', and we're on to setting up packages.

Each package should contain a different quantity of coins. For our example, let's assume we'll offer the following options: 100 coins, 250 coins, 600 coins, and 1400 coins. Go ahead and add those packages, and your offering page should now look like the following:

📘

If you haven't already, you'll need to set up products in the respective app stores on which you intend to ship your app. For more information on setting up products and adding them to RevenueCat, check out the Configuring Products guide.

Attach your products to each package, and you're ready to use to Purchases SDK to display your offering. On iOS, you could fetch the offering like this:

Purchases.shared.offerings { (offerings, error) in
    if let coinOffering = offerings?["coins"] {
        let packages = coinOffering.availablePackages
        // `packages` should contain each coin package with an identifier like 'coins-100'
    }
}

For more information displaying products, check out the Displaying Products guide.

When you're ready to purchase one of the coin packages, pass the package object to the Purchases SDK, like the following:

Purchases.shared.purchasePackage(package) { (transaction, purchaserInfo, error, userCancelled)
    if let purchaserInfo = purchaserInfo, error == nil {
        // validate the purchase with your server, and display content
    }
}

🚧

It's important to note that at the moment, logic for keeping track of consumable redemptions must be handled outside of RevenueCat. We recommend your server is set up to receive Webhook events for NON_RENEWING_PURCHASE to appropriately provide consumable content for your users.

For example: RevenueCat can track a consumable coin purchase and include it in the purchaserInfo, but cannot track if you've granted a user the appropriate number of coins for that purchase.

For more information on making purchases, check out the Making Purchases guide.

Sales, alternative packages, and more

With this structure for Offerings, creating a sale offering is easy and can be accomplished in the same way as the above steps:

  1. Create a new offering called 'coins-sale'
  2. Create new packages for the offering with appropriate coin identifiers
  3. Create the sale IAP's in respective app stores
  4. Fetch the new 'coins-sale' offering from the Purchases SDK

Conclusion

It's important to note that the above example is just that- an example. Your specific app may require a different implementation. This guide is meant as a way to understand the different ways you can use RevenueCat's powerful features for in-app purchases.

Updated 7 months ago


Non-Subscription Purchases


Using RevenueCat beyond subscriptions

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.