Logotipo de Subscription State Diagram

Subscription State Diagram

Organización
RevenueCat
subscription-state-diagram

Use this skill as the pull out reference for the full Google Play subscription state machine, showing every state and every RTDN triggered transition in one diagram.

Add to TypingMind

Descripción general

EditorRevenueCat
Repositorioplay-billing-skills
Nombre de la habilidadsubscription-state-diagram
Estrellas
58
Forks
0
Archivos incluidos
Solo instrucciones
LicenciaApache-2.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por RevenueCat en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Subscription State Diagram en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/RevenueCat/play-billing-skills/tree/main/google-play/subscription-state-diagram
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/RevenueCat/play-billing-skills.git /tmp/play-billing-skills
mkdir -p .claude/skills
cp -r /tmp/play-billing-skills/google-play/subscription-state-diagram .claude/skills/subscription-state-diagram
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Subscription State Diagram en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Subscription State Diagram automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Subscription State Diagram no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Subscription State Diagram

Phase 0: Intent

Use this skill when you need a single place to look up:

  • What states a Google Play subscription can be in.
  • Which RTDN (Real Time Developer Notification) moves a subscription from one state to the next.
  • Whether a given state grants access to paid content.
  • What token behavior to expect across renewals, pauses, holds, and resubscribes.

This is a reference skill. It does not write code for you. It hands you the map so you can point at a node, point at an edge, and then make a decision about access or acknowledgement.

Phase 1: Locate

Tell the skill which part of the state machine you care about. Pick the shortest path that matches your question.

You want to know...Jump to
What every state means and whether it grants accessStates at a Glance
Which RTDN fires on a specific transitionTransition Table
Whether to grant access right nowAccess Decision Flowchart
What happens to the purchase token across eventsToken Lifecycle
The numeric code for a notification typeRTDN Quick Reference
How long grace period, account hold, or token validity lastsTime Windows

A typical lookup looks like this:

  1. Name the current state (for example IN_GRACE_PERIOD).
  2. Name the event you observed (for example RTDN type 5).
  3. Find the row in the From IN_GRACE_PERIOD table.
  4. Read the target state and the access rule.

Phase 2: Reference Diagram

States at a Glance

StateAccessDescription
PENDINGNoPurchase initiated, payment not yet processed
PENDING_PURCHASE_CANCELEDNoPending transaction canceled; if linkedPurchaseToken is set, the previous subscription is unaffected
ACTIVEYesSubscription is paid and current
IN_GRACE_PERIODYesPayment failed, Google is retrying, user keeps access
ON_HOLDNoGrace period expired, access revoked, awaiting payment fix
PAUSEDNoUser requested pause, access revoked
CANCELEDUntil expiryCanceled but not expired, access until expiryTime
EXPIREDNoSubscription has ended

Transition Table

Every edge in the diagram. Columns: origin state, destination state, trigger, RTDN name and numeric type.

FromToTriggerRTDN
PENDINGACTIVEPayment completesSUBSCRIPTION_PURCHASED (4)
PENDINGPENDING_PURCHASE_CANCELEDPending payment canceled or expiredSUBSCRIPTION_PENDING_PURCHASE_CANCELED (20)
ACTIVEACTIVESuccessful renewalSUBSCRIPTION_RENEWED (2)
ACTIVEIN_GRACE_PERIODRenewal fails, grace period enabledSUBSCRIPTION_IN_GRACE_PERIOD (6)
ACTIVEON_HOLDRenewal fails, no grace, account hold enabledSUBSCRIPTION_ON_HOLD (5)
ACTIVECANCELEDUser or developer cancelsSUBSCRIPTION_CANCELED (3)
ACTIVEEXPIREDRevoked or refundedSUBSCRIPTION_REVOKED (12)
ACTIVEPAUSEDPause takes effect at end of periodSUBSCRIPTION_PAUSED (10)
IN_GRACE_PERIODACTIVEPayment recovered (renewal date unchanged)SUBSCRIPTION_RENEWED (2)
IN_GRACE_PERIODON_HOLDGrace expires without paymentSUBSCRIPTION_ON_HOLD (5)
IN_GRACE_PERIODEXPIREDGrace expires, no account holdSUBSCRIPTION_EXPIRED (13)
ON_HOLDACTIVEUser fixes paymentSUBSCRIPTION_RECOVERED (1)
ON_HOLDEXPIREDAccount hold period expiresSUBSCRIPTION_CANCELED (3), then SUBSCRIPTION_EXPIRED (13)
PAUSEDACTIVEPause ends, payment succeedsSUBSCRIPTION_RECOVERED (1)
PAUSEDON_HOLDPause ends, payment failsSUBSCRIPTION_ON_HOLD (5)
CANCELEDACTIVEUser restores before expirationSUBSCRIPTION_RESTARTED (7)
CANCELEDEXPIREDexpiryTime reachedSUBSCRIPTION_EXPIRED (13)
EXPIREDACTIVEUser resubscribes, new purchase tokenSUBSCRIPTION_PURCHASED (4)

RTDN Quick Reference by Number

#NameCommon Usage
1RECOVEREDRestore access after hold or pause
2RENEWEDExtend access period
3CANCELEDNote cancellation, keep access until expiry
4PURCHASEDNew subscription, grant access
5ON_HOLDRevoke access
6IN_GRACE_PERIODKeep access, warn user
7RESTARTEDRestore access, same token
8PRICE_CHANGE_CONFIRMEDDeprecated
9DEFERREDExtend billing date
10PAUSEDRevoke access at period end
11PAUSE_SCHEDULE_CHANGEDCheck pause status
12REVOKEDImmediately revoke access
13EXPIREDRevoke access, clean up
17ITEMS_CHANGEDCheck updated line items
18CANCELLATION_SCHEDULEDNote scheduled cancellation
19PRICE_CHANGE_UPDATEDCheck price change details
20PENDING_PURCHASE_CANCELEDClean up pending records
22PRICE_STEP_UP_CONSENT_UPDATEDCheck consent status

Time Windows

WindowDurationWhat Happens
Acknowledgement3 daysUnacknowledged purchases auto refund
Grace period0 to 30 days (not longer than the billing period), configurableUser keeps access while Google retries
Silent grace period1 day minimumApplies even when grace is set to 0 days
Account hold0 to 60 days; default 60 minus grace; grace + hold total 30 to 60 daysUser loses access, can recover by fixing payment
Token validity60 days post expirationAPI calls still succeed in this window
Pause duration1 week to 3 monthsDepends on billing period

Phase 3: Handling Guidance Per Transition

Each row tells you what to do when the RTDN lands. Pair this with the access rule in Phase 2.

TransitionYour handler should
PENDING to ACTIVEAcknowledge within 3 days, provision entitlement, store the purchase token
PENDING to PENDING_PURCHASE_CANCELEDClean up the pending record, do not provision; for a pending plan change or top up keep the old token's entitlement
ACTIVE to ACTIVE (renewal)Extend the entitlement to the new expiryTime, keep the same token
ACTIVE to IN_GRACE_PERIODKeep access on, surface a payment warning, trigger In App Messaging
ACTIVE to ON_HOLDRevoke access, tell the user to fix payment in Play
ACTIVE to CANCELEDKeep access until expiryTime, show an expiry countdown, log the cancel reason
ACTIVE to EXPIRED (revoke)Revoke access immediately, note the refund or revocation
ACTIVE to PAUSEDAccess ends at period end, show resume date on next open
IN_GRACE_PERIOD to ACTIVEClear the warning banner, confirm expiryTime moved forward
IN_GRACE_PERIOD to ON_HOLDRevoke access, swap the warning for a fix payment prompt
IN_GRACE_PERIOD to EXPIREDRevoke access, offer resubscribe
ON_HOLD to ACTIVERestore the entitlement, keep the existing token
ON_HOLD to EXPIREDRevoke, offer resubscribe, stop polling the token after 60 days
PAUSED to ACTIVERestore access, same token
PAUSED to ON_HOLDKeep access revoked, switch message to fix payment
CANCELED to ACTIVERestore, same token, remove the expiry countdown
CANCELED to EXPIREDRevoke, offer resubscribe
EXPIRED to ACTIVETreat as a new purchase, new token, link it to the prior user identity

Access Decision

Use the same rule across every handler.

kotlin
fun shouldGrantAccess(
    state: String,
    expiryTimeMillis: Long
): Boolean = when (state) {
    "SUBSCRIPTION_STATE_ACTIVE",
    "SUBSCRIPTION_STATE_IN_GRACE_PERIOD" -> true
    "SUBSCRIPTION_STATE_CANCELED" ->
        System.currentTimeMillis() < expiryTimeMillis
    else -> false
}

Token Lifecycle

EventToken Behavior
New purchaseNew token
RenewalSame token, new Order ID
Upgrade or downgradeNew token, old token linked via linkedPurchaseToken
Restore before expirySame token
Resubscribe after expiryNew token
Pause and resumeSame token
Grace period recoverySame token
Account hold recoverySame token

References

Preguntas frecuentes

¿Qué hace la habilidad de IA Subscription State Diagram?

Use this skill as the pull out reference for the full Google Play subscription state machine, showing every state and every RTDN triggered transition in one diagram.

¿Por qué usar Subscription State Diagram en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Subscription State Diagram está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Subscription State Diagram en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/RevenueCat/play-billing-skills/tree/main/google-play/subscription-state-diagram. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Subscription State Diagram?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Subscription State Diagram?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Subscription State Diagram con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Subscription State Diagram?

Sí. RevenueCat la ha publicado en GitHub bajo la licencia Apache-2.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇