Logo von Billing Response Codes

Billing Response Codes

Organisation
RevenueCat
billing-response-codes

Use this skill as a reference lookup for every Play Billing Library BillingResponseCode and sub response code, with description, category, and handling guidance. Grounded in PBL 9.x.

Übersicht

HerausgeberRevenueCat
Repositoryplay-billing-skills
Skill-Namebilling-response-codes
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 Billing Response Codes 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/billing-response-codes
  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/billing-response-codes .claude/skills/billing-response-codes
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Billing Response Codes 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 Billing Response Codes 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 Billing Response Codes 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.

Billing Response Codes

Phase 0: Intent

Use this skill when you need to look up the meaning, category, or handling strategy for a value returned by BillingResult.getResponseCode() or BillingResult.getOnPurchasesUpdatedSubResponseCode() in the Play Billing Library. This reference covers:

  • All BillingResponseCode constants defined in PBL 9.x (the constant set is unchanged from PBL 8.x; v9 added no codes and removed none).
  • All OnPurchasesUpdatedSubResponseCode constants added in PBL 8.0.
  • Retry eligibility for each code.
  • The recommended response strategy per code.
  • A decision tree that maps any received code to an action.

Use this skill to answer questions like "what does response code 7 mean", "should I retry on SERVICE_UNAVAILABLE", or "how do I handle ITEM_ALREADY_OWNED".

Do not use this skill to author new integration code from scratch. Use the launch or purchase flow skills for that. This skill is a lookup table.

Phase 1: Locate

The authoritative copy of the tables and decision tree lives in the full appendix on revenuecat.com. When a question asks for:

  • The literal integer value of a code, see "Response Codes".
  • Sub response codes introduced in PBL 8.0, see "Sub Response Codes (PBL 8.0+)".
  • The retry strategy for a code, see "Retry Implementation Summary".
  • A full flow from received code to action, see "Error Handling Decision Tree".

The tables reproduced below in Phase 2 mirror the appendix verbatim so you can answer most lookups without opening the chapter.

Phase 2: Reference Tables

BillingResponseCode values

CodeValueRetriableDescriptionRecommended Strategy
OK0N/AOperation succeededProcess the result normally.
USER_CANCELED1NoUser dismissed the purchase dialog. Since PBL 8.3 also returned when the user left to pay in an external app (e-wallet) and did not return (debug message BILLING_ACTIVITY_PAUSED; ERROR before 8.3).No action needed. Do not show an error message.
SERVICE_UNAVAILABLE2YesGoogle Play service is temporarily unavailableRetry with exponential backoff (2s base, 2x factor, max 3 attempts).
BILLING_UNAVAILABLE3No (auto)Billing is unavailable on this device or for this userDo not auto retry. Check Play Store version and user account. Let the user try again manually. PBL 9 (with androidx.core 1.9+) also routes a system blocked Play Store here with a "Play Store is blocked" debugMessage, where PBL 8 returned ERROR.
ITEM_UNAVAILABLE4NoThe requested product is not available for purchaseRefresh product details with queryProductDetailsAsync(). The product may have been deactivated.
DEVELOPER_ERROR5NoInvalid arguments passed to the APIFix your code. Check product IDs, offer tokens, and parameter construction. This is a programming error.
ERROR6YesAn internal Google Play error occurredRetry with exponential backoff. If persistent, report to Google.
ITEM_ALREADY_OWNED7NoThe user already owns this item (a subscription, a non consumable, or a consumable that has not been consumed yet)Call queryPurchasesAsync() to refresh your local purchase cache. The user may have purchased on another device.
ITEM_NOT_OWNED8NoAttempted to consume or acknowledge an item the user does not ownCall queryPurchasesAsync() to refresh your local purchase cache. The purchase may have been refunded.
NETWORK_ERROR12YesA network error occurred during the operationRetry with a short delay (1-2 seconds). Check device connectivity.
SERVICE_DISCONNECTED-1YesThe BillingClient is not connected to the Play Store billing serviceWith enableAutoServiceReconnection() (opt in, PBL 8+) the library reconnects before the next call; if you still get this code, retry the call (simple retry in session, exponential backoff in the background). Without it, call startConnection() and retry.
FEATURE_NOT_SUPPORTED-2NoThe requested feature is not supported on this device or Play Store versionCheck isFeatureSupported() before calling feature specific APIs. Provide fallback behavior.
SERVICE_TIMEOUT-3Yes (Deprecated)The request timed outDeprecated in recent PBL versions. Treat as SERVICE_UNAVAILABLE and retry with backoff.

Sub Response Codes (PBL 8.0+)

Sub response codes provide more granular information about why a purchase failed. They are only available in the PurchasesUpdatedListener.onPurchasesUpdated() callback, retrieved via BillingResult.getOnPurchasesUpdatedSubResponseCode().

Sub Response CodeDescriptionWhen It AppearsRecommended Action
NO_APPLICABLE_SUB_RESPONSE_CODENo specific sub response appliesDefault value for most responsesHandle based on the main response code only.
PAYMENT_DECLINED_DUE_TO_INSUFFICIENT_FUNDSUser's available funds are less than the purchase priceWhen the main response indicates a payment failureShow a message suggesting the user check their payment method balance.
USER_INELIGIBLEUser does not meet eligibility requirements for an offerWhen the user attempts to use an offer they are not eligible forShow standard pricing without the offer. Check your offer eligibility logic.

Accessing sub response codes

kotlin
val listener = PurchasesUpdatedListener { billingResult, purchases ->
    if (billingResult.responseCode != BillingResponseCode.OK) {
        val subCode = billingResult.onPurchasesUpdatedSubResponseCode
        when (subCode) {
            OnPurchasesUpdatedSubResponseCode.PAYMENT_DECLINED_DUE_TO_INSUFFICIENT_FUNDS ->
                showInsufficientFundsMessage()
            OnPurchasesUpdatedSubResponseCode.USER_INELIGIBLE ->
                showStandardPricing()
            else -> handleGeneralError(billingResult)
        }
    }
}

Retry strategy summary

StrategyBase DelayFactorMax AttemptsUse For
Simple retry1-2 seconds1x (fixed)3NETWORK_ERROR
Exponential backoff2 seconds2x3SERVICE_UNAVAILABLE, ERROR, SERVICE_TIMEOUT
Reconnect, then retryLibrary (auto reconnection) or startConnection()Simple in session, backoff in background3SERVICE_DISCONNECTED
User initiatedN/AN/AN/ABILLING_UNAVAILABLE
No retryN/AN/AN/AUSER_CANCELED, DEVELOPER_ERROR, FEATURE_NOT_SUPPORTED

Phase 3: Handling Guidance

When you receive a BillingResult, walk it through this decision tree:

  1. Is responseCode equal to OK?

    • Yes: process the result. Done.
    • No: continue.
  2. Is responseCode equal to USER_CANCELED?

    • Yes: do nothing. The user chose to cancel. Done.
    • No: continue.
  3. Is the error retriable? (SERVICE_UNAVAILABLE, ERROR, NETWORK_ERROR, SERVICE_DISCONNECTED, SERVICE_TIMEOUT)

    • Yes: retry with the matching strategy from the retry summary table. Simple retry for NETWORK_ERROR, exponential backoff for service errors. If all retries fail, show an error message.
    • No: continue.
  4. Is it a cache sync issue? (ITEM_ALREADY_OWNED, ITEM_NOT_OWNED)

    • Yes: call queryPurchasesAsync() to refresh your purchase cache. Update UI accordingly.
    • No: continue.
  5. Is it a product issue? (ITEM_UNAVAILABLE)

    • Yes: refresh product details. The product may no longer be available.
    • No: continue.
  6. Is it a device or environment issue? (BILLING_UNAVAILABLE, FEATURE_NOT_SUPPORTED)

    • Yes: show a user facing message. Do not retry automatically. Let the user initiate a retry.
    • No: continue.
  7. Is it a developer error? (DEVELOPER_ERROR)

    • Yes: log the error with full details. Fix the API usage in your code. This should not happen in production.

Category quick reference

Group each code into one of six buckets so you can route it to the right handler:

  • Success: OK.
  • User intent: USER_CANCELED.
  • Transient service or network: SERVICE_UNAVAILABLE, ERROR, NETWORK_ERROR, SERVICE_DISCONNECTED, SERVICE_TIMEOUT.
  • Cache sync: ITEM_ALREADY_OWNED, ITEM_NOT_OWNED.
  • Catalog or product: ITEM_UNAVAILABLE.
  • Environment or configuration: BILLING_UNAVAILABLE, FEATURE_NOT_SUPPORTED.
  • Programming error: DEVELOPER_ERROR.

Checking a code with when

kotlin
fun classify(code: Int): Category = when (code) {
    BillingResponseCode.OK -> Category.SUCCESS
    BillingResponseCode.USER_CANCELED -> Category.USER_INTENT
    BillingResponseCode.SERVICE_UNAVAILABLE,
    BillingResponseCode.ERROR,
    BillingResponseCode.NETWORK_ERROR,
    BillingResponseCode.SERVICE_DISCONNECTED,
    BillingResponseCode.SERVICE_TIMEOUT -> Category.TRANSIENT
    BillingResponseCode.ITEM_ALREADY_OWNED,
    BillingResponseCode.ITEM_NOT_OWNED -> Category.CACHE_SYNC
    BillingResponseCode.ITEM_UNAVAILABLE -> Category.CATALOG
    BillingResponseCode.BILLING_UNAVAILABLE,
    BillingResponseCode.FEATURE_NOT_SUPPORTED -> Category.ENVIRONMENT
    BillingResponseCode.DEVELOPER_ERROR -> Category.PROGRAMMING
    else -> Category.UNKNOWN
}

References

Häufig gestellte Fragen

Was macht der KI-Skill Billing Response Codes?

Use this skill as a reference lookup for every Play Billing Library BillingResponseCode and sub response code, with description, category, and handling guidance. Grounded in PBL 9.x.

Warum Billing Response Codes in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Billing Response Codes 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 Billing Response Codes 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/billing-response-codes 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 Billing Response Codes 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 Billing Response Codes verwenden?

So viele Sie möchten. In TypingMind können Sie Billing Response Codes 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 Billing Response Codes 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 👇