Logo von Cancellations Pauses Winback

Cancellations Pauses Winback

Organisation
RevenueCat
cancellations-pauses-winback

Use this skill when implementing cancellations, developer initiated revocations, subscription pauses, and winback offers on Google Play. Covers user initiated cancellation, system cancellation, developer revoke/refund, pause resume flow, and winback API tools.

Übersicht

HerausgeberRevenueCat
Repositoryplay-billing-skills
Skill-Namecancellations-pauses-winback
Sterne
58
Forks
0
Mitgelieferte Dateien
Nur Anweisungen
LizenzApache-2.0
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von RevenueCat auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Cancellations Pauses Winback in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/RevenueCat/play-billing-skills/tree/main/google-play/cancellations-pauses-winback
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

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/cancellations-pauses-winback .claude/skills/cancellations-pauses-winback
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Cancellations Pauses Winback in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Cancellations Pauses Winback automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Cancellations Pauses Winback nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Cancellations, Pauses, and Winback

A subscription can end in several ways, and each one has a different effect on user access, entitlement records, and recovery options. Use this skill when you are wiring up any end of life or pause flow for a Google Play subscription: user cancellation, developer cancellation, system cancellation after payment failure, pause, resume, restore, resubscribe, deferral, or revocation.

Phase 1: Identify the Scenario

Before writing any code, identify which of the following you are handling. The later phases branch on this choice.

  • The user is canceling through Play (silent to your app, signaled by RTDN).
  • You are canceling from your backend on the user's behalf or for your own reasons.
  • Google canceled after exhausting grace period and account hold.
  • The user is pausing, resuming, or a pause is scheduled.
  • The user is restoring a cancellation before expiry, or resubscribing after expiry.
  • You are deferring billing as goodwill or compensation.
  • You are revoking immediately due to fraud or a terms violation.

Phase 2: Plan by Cancellation Type

Each cancellation type behaves differently with respect to access, refunds, RTDN signals, and recovery. Plan the entitlement logic using the matrix below before you touch the API.

Cancellation type matrix

TypeAPI or TriggerAccess AfterRefundPrimary RTDNcanceledStateContext member
User initiatedPlay Subscriptions CenterUntil expiryTimeNone (prorated not issued)SUBSCRIPTION_CANCELEDuserInitiatedCancellation
Developer, user requestedpurchases.subscriptionsv2.cancel with USER_REQUESTED_STOP_RENEWALSUntil expiryTimeNoneSUBSCRIPTION_CANCELEDNot documented for this cancellationType; read whichever member is set
Developer, your reasonpurchases.subscriptionsv2.cancel with DEVELOPER_REQUESTED_STOP_PAYMENTSUntil expiryTimeNoneSUBSCRIPTION_CANCELEDdeveloperInitiatedCancellation
System, payment failureAutomatic after grace + account holdNone from the moment account hold expiresNoneSUBSCRIPTION_CANCELEDsystemInitiatedCancellation
Replacement (plan change)Plan change flowHandled by new tokenN/ASUBSCRIPTION_PURCHASED on the new token (linkedPurchaseToken = old token); old token may report SUBSCRIPTION_EXPIRED (DEFERRED)replacementCancellation
Revokepurchases.subscriptionsv2.revokeImmediately terminatedThe refund type you pass (fullRefund or proratedRefund)SUBSCRIPTION_REVOKEDn/a (terminated)

Pause versus cancel

SignalWhat it meansAccess
SUBSCRIPTION_PAUSE_SCHEDULE_CHANGEDPause scheduled, starts at end of current billing periodStill active, full access
SUBSCRIPTION_PAUSEDPause has begunRevoke access
SUBSCRIPTION_RECOVEREDPause ended, payment collectedRestore access
SUBSCRIPTION_RESTARTEDUser restored a cancellation before expiryTimeAccess uninterrupted, same token

Installment subscription caveat

During the commitment period of an installment plan, a user cancellation is either blocked outright or scheduled for after the commitment. A scheduled cancellation arrives as SUBSCRIPTION_CANCELLATION_SCHEDULED, not SUBSCRIPTION_CANCELED. Treat scheduled cancellation as "user intends to leave, still paying". Do not revoke access. The final SUBSCRIPTION_CANCELED arrives later when the commitment completes.

Entitlement rule that applies to every type

A canceled subscription with a future expiryTime is still an active subscription from the user's perspective. The only exceptions are revocation (immediate) and SUBSCRIPTION_PAUSED (immediate).

Phase 3: Execute

Use the snippets below as starting points. Each one matches a specific API call or RTDN handler from Phase 2.

Entitlement check that survives cancellation

kotlin
fun hasActiveSubscription(
    subscription: SubscriptionPurchaseV2
): Boolean {
    val now = System.currentTimeMillis()
    val expiry = subscription.lineItems
        .firstOrNull()
        ?.expiryTime
        ?.let { Instant.parse(it).toEpochMilli() } ?: return false
    return now < expiry
}

Inspect canceledStateContext to segment churn

kotlin
fun logCancellationReason(
    subscription: SubscriptionPurchaseV2
) {
    val context = subscription.canceledStateContext ?: return
    when {
        context.userInitiatedCancellation != null -> analytics.trackChurn(
            reason = "user",
            surveyResponse = context.userInitiatedCancellation.cancelSurveyResult?.reason
        )
        context.systemInitiatedCancellation != null -> analytics.trackChurn(reason = "payment_failure")
        context.developerInitiatedCancellation != null -> analytics.trackChurn(reason = "developer")
        context.replacementCancellation != null -> Unit // plan change, not churn
    }
}

This mapping is what drives later winback decisions. A "too expensive" survey answer is a discount candidate. A payment failure is a payment update prompt. A fraud cancellation is not a winback candidate.

Developer initiated cancellation

Call purchases.subscriptionsv2.cancel with the package name, purchase token, and body {"cancellationContext": {"cancellationType": ...}}:

  • USER_REQUESTED_STOP_RENEWALS when the user asked you to cancel (the user can restore it).
  • DEVELOPER_REQUESTED_STOP_PAYMENTS when you are canceling for your own reasons (cannot be restored; for installments it stops the next payment).

Both leave access intact until expiryTime. Store the cancellationType you sent and your own reason at cancel time: developerInitiatedCancellation has no fields, so canceledStateContext alone cannot tell the two apart.

Pause RTDN handler

kotlin
fun handlePauseNotification(
    notificationType: Int,
    purchaseToken: String
) {
    when (notificationType) {
        11 -> markPauseScheduled(purchaseToken) // PAUSE_SCHEDULE_CHANGED
        10 -> revokeAccess(purchaseToken)       // PAUSED
        1  -> grantAccess(purchaseToken)        // RECOVERED
    }
}

Surface paused subscriptions on the client (PBL 8.1+)

kotlin
val params = QueryPurchasesParams.newBuilder()
    .setProductType(ProductType.SUBS)
    .includeSuspendedSubscriptions(true)
    .build()

val result = billingClient.queryPurchasesAsync(params)

Check purchase.isSuspended: when true, do not grant access. It covers both paused and account hold, so use a neutral "resume or fix payment" call to action to the subscriptions center, or ask your backend which state it is.

Restore before expiry

kotlin
fun handleSubscriptionRestarted(purchaseToken: String) {
    val record = database.findByPurchaseToken(purchaseToken) ?: return
    record.canceledAt = null
    record.status = "ACTIVE"
    database.update(record)
}

The purchase token does not change on restore.

Link a resubscribe to the original account

kotlin
fun handleResubscribe(new: SubscriptionPurchaseV2, newToken: String) {
    // Read before acknowledging: outOfAppPurchaseContext is removed after acknowledgement.
    val ctx = new.outOfAppPurchaseContext
    val user = ctx?.expiredExternalAccountIdentifiers?.obfuscatedExternalAccountId
        ?.let { database.findByObfuscatedAccountId(it) }
        ?: ctx?.expiredPurchaseToken?.let { database.findUserByPurchaseToken(it) }
    if (user != null) {
        database.addSubscription(user.id, newToken, "ACTIVE")
    } else {
        handleNewSubscription(new)
    }
}

Prerequisite: set BillingFlowParams.Builder.setObfuscatedAccountId(hashedUserId) on the original purchase. Without it, expiredExternalAccountIdentifiers carries no account ID; fall back to expiredPurchaseToken.

Defer billing

kotlin
fun deferSubscription(packageName: String, purchaseToken: String) {
    val sub = playApi.purchases().subscriptionsv2().get(packageName, purchaseToken).execute()
    val request = DeferSubscriptionPurchaseRequest().setDeferralContext(
        DeferralContext()
            .setEtag(sub.etag)                       // required, from subscriptionsv2.get
            .setDeferDuration("${14 * 24 * 3600}s")  // relative, 1 day to 1 year per call
    )
    playApi.purchases().subscriptionsv2()
        .defer(packageName, purchaseToken, request)
        .execute() // returns itemExpiryTimeDetails[] with each item's new expiryTime
}

Constraints: deferDuration from 1 day to 1 year per call; all items in a subscription with add ons move by the same duration. Deferral keeps the same token and can be applied multiple times. It does not work on canceled subscriptions.

Revoke immediately

kotlin
fun revokeSubscription(
    packageName: String,
    purchaseToken: String,
    reason: String
) {
    val request = RevokeSubscriptionPurchaseRequest().setRevocationContext(
        RevocationContext().setProratedRefund(RevocationContextProratedRefund())
    )
    playApi.purchases().subscriptionsv2()
        .revoke(packageName, purchaseToken, request)
        .execute()
    database.findByPurchaseToken(purchaseToken)?.let {
        it.status = "REVOKED"
        it.revokeReason = reason // local analytics only; the API call itself carries no reason
        database.update(it)
    }
}

Revocation is appropriate for confirmed fraud, serious terms of service violations, or proactive chargeback response. It is not a substitute for a standard cancel plus refund. Google issues the refund type you chose (fullRefund or proratedRefund) and sends SUBSCRIPTION_REVOKED so your backend can reconcile even if the local write failed. itemBasedRefund {productId} is different: it revokes and fully refunds one item of a subscription with add ons, and the subscription stays active while other items remain.

Winback Eligibility Checks

Use the canceledStateContext member from Phase 3 to decide who is eligible for a winback offer:

  • userInitiatedCancellation with a price related survey answer: discount offer.
  • systemInitiatedCancellation: payment method update prompt, not a discount.
  • developerInitiatedCancellation where your own records show you canceled for fraud or TOS: exclude from winback.
  • replacementCancellation: not a churn event, exclude.

A paused subscriber is not a winback candidate either. They have already signaled intent to return, so the right surface is a resume prompt, not a discount.

References

Häufig gestellte Fragen

Was macht der KI-Skill Cancellations Pauses Winback?

Use this skill when implementing cancellations, developer initiated revocations, subscription pauses, and winback offers on Google Play. Covers user initiated cancellation, system cancellation, developer revoke/refund, pause resume flow, and winback API tools.

Warum Cancellations Pauses Winback in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Cancellations Pauses Winback besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Cancellations Pauses Winback in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/RevenueCat/play-billing-skills/tree/main/google-play/cancellations-pauses-winback ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Cancellations Pauses Winback nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Cancellations Pauses Winback verwenden?

So viele Sie möchten. In TypingMind können Sie Cancellations Pauses Winback mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Cancellations Pauses Winback kostenlos?

Ja. Der Skill wird von RevenueCat auf GitHub unter der Lizenz Apache-2.0 veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇