subscription-states

subscription-states is a skill for Claude Code, Codex from RevenueCat/play-billing-skills. It costs 62 tokens per session (1,718 once invoked), scanned A, original, Apache-2.0.

A guide to the seven states a Google Play subscription can occupy, from pending and active to paused, canceled, and expired. It connects each state with the amount of access an app should grant.

In plain words
What is it for?
Use it to design backend entitlement rules for active, grace-period, on-hold, paused, canceled, and expired subscriptions. It also explains which Google Play API response should be treated as the authoritative source.
Why use it?
Inferring access from the wrong signal can either give away paid content or remove access before the user has used what they paid for. This guide uses Google's subscription state and expiry information to make that decision.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to design backend entitlement rules for active, grace-period, on-hold, paused, canceled, and expired subscriptions. It also explains which Google Play API response should be treated as the authoritative source.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/revenuecat/play-billing-skills/subscription-states
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add RevenueCat/play-billing-skills --skill subscription-states
Clone the repo
git clone --depth 1 https://github.com/RevenueCat/play-billing-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for subscription-states

README.md
[![agentmods](https://agentmods.dev/badge/skills/revenuecat/play-billing-skills/subscription-states/github.svg)](https://agentmods.dev/skills/revenuecat/play-billing-skills/subscription-states)
Your own site
<a href="https://agentmods.dev/skills/revenuecat/play-billing-skills/subscription-states"><img src="https://agentmods.dev/badge/skills/revenuecat/play-billing-skills/subscription-states/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for subscription-states

Your own site · 80×15
<a href="https://agentmods.dev/skills/revenuecat/play-billing-skills/subscription-states"><img src="https://agentmods.dev/badge/skills/revenuecat/play-billing-skills/subscription-states.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,718 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.01718
Opus 5.5 $0.00025 $0.00687
Sonnet 5.5 $0.00012 $0.00344
Haiku 4.5 $0.00006 $0.00172

Measured 1mo ago against content hash 152bcec2eb54, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

subscription-states scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

google-play/subscription-states/SKILL.md · 160 lines

How it starts

The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Subscription States

A Google Play subscription moves through eight states between the first purchase and final termination. Each state has a concrete access decision: grant, retain until expiry, or revoke. Get the mapping wrong and you either give away paid content or revoke access a user already paid for.

This skill walks you through confirming your app reads the correct state source, deciding the access rule for each state, and writing the mapping code.

Phase 1: Discovery

Before changing anything, confirm where your entitlement decision reads subscription state from. The authoritative source is the subscriptionState field on the SubscriptionPurchaseV2 resource returned by purchases.subscriptionsv2.get on the Google Play Developer API. The client Purchase object from queryPurchasesAsync() does not carry this field.

Answer these questions:

  1. Does your backend call purchases.subscriptionsv2.get (not the legacy purchases.subscriptions.get)?
  2. Does your entitlement function read subscriptionState from that response rather than inferring state from the RTDN notification type?
  3. Does the function check expiryTime when the state is SUBSCRIPTION_STATE_CANCELED?
  4. Does your client code treat a Purchase returned by queryPurchasesAsync() as "has a purchase," not "has access"?

If any answer is no, fix the source of truth first. Inferring state from the notification type is the single most common cause of wrong entitlement decisions, because two different transitions can produce the same RTDN type. For example, SUBSCRIPTION_RECOVERED fires both when a user fixes payment during account hold and when a paused subscription resumes, while a payment fixed during grace period arrives as SUBSCRIPTION_RENEWED.

Confirm the app is on subscriptionsv2 before moving on.

Phase 2: Plan the Decision Per State

Decide the access rule for each of the eight states. Use this table as the contract your code must match:

State Access Decision Reason
PENDING Do not grant Payment has not settled yet.
PENDING_PURCHASE_CANCELED Do not grant on this token Pending payment canceled or expired; if linkedPurchaseToken is set, the previous subscription keeps its own state.
ACTIVE Grant Paid and within the current billing period.
IN_GRACE_PERIOD Grant Payment failed, Google is retrying, user keeps access during the configured window.
CANCELED Retain until expiryTime User canceled but already paid for the current period.
ON_HOLD Revoke Grace period expired without recovery.
PAUSED Revoke Voluntary pause, no billing during the window.
EXPIRED Revoke Subscription has ended.

Read the full file on GitHub · 160 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +2 lines · +8 tokens per session 152bcec2eb54
  2. 3mo ago First seen · 158 lines · 54 tokens per session scan A e7fa4393aefc

Subscribe to this mod's changes

subscription-states is a skill published in the GitHub repository RevenueCat/play-billing-skills (60 stars, last pushed 16d ago), licensed Apache-2.0. It adds 62 tokens to every session and 1,718 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

subscription-states compared with skills from other repositories

subscription-states next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
subscription-statesRevenueCat/play-billing-skillsSkill6016d agoApache-2.0A62Claude Code, Codex
play-billing-library-version-upgradeandroid/skillsSkill11k9d agoApache-2.0A39Claude Code
asc-revenuecat-catalog-syncrorkai/app-store-connect-cli-skillsSkill1.2k2d agoMITA51Claude Code
axiom-implement-iapCharlesWiltgen/AxiomSkill1.3ktodayMITA29Codex
subscription-lifecyclershankras/claude-code-apple-skillsSkill92323d agoMITA55Claude Code
google-playCraftOS-dev/CraftBotSkill4313d agoMITA70Claude Code, Codex
subscription-offersrshankras/claude-code-apple-skillsSkill92323d agoMITA55Claude Code