/revenuecat-play-billing:rc-subscriptionsfrom revenuecat-play-billing
Models Android subscriptions through RevenueCat's object model: Offerings, Packages, StoreProduct, SubscriptionOption, PricingPhase, and their mapping to Google Play's Subscription, Base Plan, and Offer hierarchy.
Ships in revenuecat-play-billing. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Google Play exposes subscriptions through a three tier hierarchy: Subscription, Base Plan, and Offer. RevenueCat wraps that hierarchy in a flatter model you configure from the dashboard: Offerings, Packages, and SubscriptionOptions. You fetch an Offering, pick a Package, and in most flows let the SDK choose the right SubscriptionOption for you.
The mapping from Google Play to RevenueCat:
| Google Play | RevenueCat |
|---|---|
Subscription + Base Plan (subId:basePlanId) | StoreProduct (one per base plan) |
| Base Plan without offer | SubscriptionOption with isBasePlan == true |
| Offer on that base plan | SubscriptionOption (offer) |
| Group of base plans grouped in dashboard | Package inside an Offering |
Key types you will touch:
Offering: a dashboard configured group of Package objects. offerings.current is the one you show by default.Package: a purchasable slot (monthly, annual, weekly, custom). Exposes a product: StoreProduct.StoreProduct: one base plan of a Google Play subscription (id is subId:basePlanId). Its subscriptionOptions hold that base plan and its offers, plus a defaultOption.SubscriptionOption: either a base plan or an offer. Has pricingPhases, tags, and an id.PricingPhase: one billing segment (intro trial, intro price, or recurring). Has billingPeriod, price, offerPaymentMode, and recurrenceMode.See the Subscriptions chapter on revenuecat.com for the object model diagram showing the full Offerings hierarchy alongside the CustomerInfo hierarchy used for entitlement checks.
Before you write code, map your paywall to the object model. Answer these three questions.
offerings.current. This is the Default offering set in the dashboard and is the standard choice.offerings.all["experiment-a"]. You keep the dashboard in charge of which products appear, so no app update ships when the catalog changes.Two access patterns, pick the one that matches your layout:
| Pattern | API | When to use |
|---|---|---|
| Named slots | offering.monthly, offering.annual, offering.weekly | Fixed paywall with known durations |
| Iteration | offering.availablePackages | Dynamic layout, unknown durations, or custom package types |
Standard PackageType values: MONTHLY, ANNUAL, WEEKLY, TWO_MONTH, THREE_MONTH, SIX_MONTH, LIFETIME. Anything else is PackageType.CUSTOM.
| Situation | What to pass to PurchaseParams |
|---|---|
| Standard paywall, user gets best eligible offer automatically | Package |
| You need a specific offer (win back, promo, tag selected) | SubscriptionOption |
The SDK's defaultOption logic:
"rc-ignore-offer" or "rc-customer-center".Trial eligibility is not filtered by the SDK. Google Play only returns offers the user is eligible for, so if a user already consumed a free trial, that option simply will not appear in subscriptionOptions and the base plan becomes the default.
val offerings = Purchases.sharedInstance.awaitOfferings()
val offering = offerings.current ?: return
val monthly = offering.monthly ?: return
val product = monthly.product
val price = product.price.formatted
val period = product.period?.iso8601 // "P1M", "P1Y", null for one time
For a dynamic list:
for (pkg in offering.availablePackages) {
render(pkg.product.title, pkg.product.price.formatted, pkg.packageType)
}
When the paywall shows a Package and you want the SDK to pick the best offer, pass the Package directly.
val params = PurchaseParams.Builder(activity, monthly).build()
val result = Purchases.sharedInstance.awaitPurchase(params)
subscriptionOptions for a specific offerUse this when the paywall targets an offer by tag or offer ID, for example a win back offer.
val product = offering.monthly?.product ?: return
val winBack = product.subscriptionOptions
?.firstOrNull { it.tags.contains("win-back") }
val option = winBack ?: product.defaultOption ?: return
val params = PurchaseParams.Builder(activity, option).build()
Always fall back to defaultOption so the paywall still works when the targeted offer is absent (for example, the user is not eligible).
pricingPhasesThe first PricingPhase is the trial or intro price when present. Use offerPaymentMode for trial detection.
val option = pkg.product.defaultOption ?: return
val first = option.pricingPhases.first()
val isTrial = first.offerPaymentMode == OfferPaymentMode.FREE_TRIAL
billingPeriod.value is the count in the period's unit, not days. A P1W period gives value = 1, unit = WEEK. Build labels off both fields:
val p = first.billingPeriod
val label = when (p.unit) {
Period.Unit.DAY -> "${p.value} day"
Period.Unit.WEEK -> "${p.value} week"
Period.Unit.MONTH -> "${p.value} month"
Period.Unit.YEAR -> "${p.value} year"
else -> p.iso8601
}
Prepaid base plans use the same SubscriptionOption API. Their pricingPhases report RecurrenceMode.NON_RECURRING. To accept pending purchases for prepaid plans, enable the flag at configuration time.
PurchasesConfiguration.Builder(context, apiKey)
.pendingTransactionsForPrepaidPlansEnabled(true)
.build()
Prefer entitlements. They reflect server computed access state including grace period, account hold, and cancellation with remaining time.
val info = result.customerInfo
val isPro = info.entitlements["pro"]?.isActive == true
If you need the raw product ID, use customerInfo.activeSubscriptions. It returns a Set<String> of "subscriptionId:basePlanId" entries.
| Question | Answer |
|---|---|
| How do I fetch products? | Purchases.sharedInstance.awaitOfferings() then offerings.current. |
| How do I present durations? | offering.monthly/annual/weekly or iterate availablePackages. |
| How do I purchase? | Pass the Package to PurchaseParams and let defaultOption apply. |
| How do I target a specific offer? | Filter product.subscriptionOptions by tag or ID, pass the SubscriptionOption. |
| How do I detect a free trial? | pricingPhases.first().offerPaymentMode == OfferPaymentMode.FREE_TRIAL. |
| How do I check access? | customerInfo.entitlements["<id>"]?.isActive. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub revenuecat/ai-toolkit --plugin revenuecat-play-billing20 skills in this plugin
/rc-alternative-billingUse this skill when scoping Google Play alternative billing work with RevenueCat Android SDK 11.x. Documents the support status as of purchases-android 11.1.0, which flows RevenueCat abstracts, and which require direct integration./rc-backendUse this skill when your backend needs to read or update RevenueCat state on Android. Covers the RevenueCat REST API (v1 subscribers endpoint, grant/revoke entitlements, attributes), secret vs public SDK API key usage, and why you do not build a receipt verification backend with RevenueCat./rc-cancellations-pauses-winbackUse this skill when surfacing cancellation, pause, and winback state on Android with RevenueCat. Covers reading unsubscribeDetectedAt, billingIssueDetectedAt, pause state and resume date via SubscriptionInfo.autoResumeDate, showManageSubscriptions for the deep link, and the SUBSCRIPTION_PAUSED webhook./rc-catalog-managementUse this skill when managing the Android product catalog through the Play Console and the RevenueCat dashboard. Covers the two sided catalog flow (create in Play Console, import or map in RevenueCat), entitlement and offering maintenance, and why you do not call the Google Play Developer API directly./rc-configuring-the-sdkUse this skill when adding and configuring the RevenueCat Android SDK (purchases-android, artifact com.revenuecat.purchases:purchases) in an app. Covers the Gradle dependency, Purchases.configure with PurchasesConfiguration, initial app user id strategy, and log level./rc-error-handlingUse this skill when handling errors from the RevenueCat Android SDK. Covers PurchasesError, the PurchasesErrorCode enum, the userCancelled flag on PurchasesTransactionException, and the recommended UI response per code.Other plugins' skills for the same job