gplay-purchase-verification

Verifies Google Play in-app purchases and subscriptions server-side using the Google Play Developer API.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/lettucebo/Skills --skill gplay-purchase-verification-lettucebo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gplay-purchase-verification
Source: https://github.com/lettucebo/Skills/tree/main/skills/google-play-console-cli/gplay-purchase-verification
Command: npx skills add https://github.com/lettucebo/Skills --skill gplay-purchase-verification-lettucebo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires googleapis, google-api-python-client, google-cloud-pubsub.

What problem does it solve? Client-side purchase checks can be bypassed, so backend systems need a reliable way to confirm that users actually paid, acknowledge purchases before Google auto-refunds them, and react to subscription lifecycle events like cancellations, refunds, and expirations. ## Core Features & Use Cases - Purchase Verification: Query in-app product and subscription purchase states via the Google Play Developer API (including the recommended subscriptionsv2 endpoint), then acknowledge or consume purchases. - Subscription Lifecycle Management: Cancel, defer, and revoke subscriptions, decode Real-time Developer Notifications (RTDN) from Pub/Sub, and list voided purchases to remove entitlements. - Order Operations: Retrieve or batch-retrieve order details and issue refunds with a mandatory confirmation flag. - Use Case: A backend developer adds a /verify-purchase endpoint in Node.js or Python that validates a purchase token with Google, acknowledges the purchase within the 3-day window, and grants the user access only after verification succeeds. ## Quick Start Ask the agent to verify a Google Play purchase token for your package and product ID and show the backend code to acknowledge it.

Frequently Asked Questions about gplay-purchase-verification

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify a Google Play purchase on my server?▼

Verify a Google Play purchase server-side by calling purchases.products.get with the package name, product ID, and purchase token using a service account. Check that purchaseState is 0 (purchased), then acknowledge the purchase before granting access.

How to verify Google Play subscriptions with the Developer API?▼

Use the purchases.subscriptionsv2.get endpoint with the package name and subscription token, which returns the SubscriptionPurchaseV2 model reflecting base plans and offers. The legacy v1 subscriptions.get endpoint still works but is the older shape.

What happens if I don't acknowledge a Google Play purchase?▼

Unacknowledged purchases are automatically refunded by Google after 3 days. After verifying a purchase on your backend, always call purchases.products.acknowledge with the purchase token to keep the entitlement valid.

Does Google Play purchase verification work with Node.js and Python?▼

Yes, verification works with the official googleapis client libraries in both Node.js (googleapis androidpublisher v3) and Python (google-api-python-client). Both authenticate with a service account JSON key scoped to androidpublisher.

Why does purchase verification return 404 or 410 errors?▼

A 404 means the purchase token is invalid or expired, while 410 means the purchase was refunded or canceled. Do not retry these errors; instead deny access and check the voided purchases list to remove entitlements.

How do I handle Google Play subscription renewal and cancellation events?▼

Set up Real-time Developer Notifications by creating a Pub/Sub topic and linking it in Play Console monetization settings. Your subscriber decodes each notification's type and purchase token to handle renewals, cancellations, expirations, and revocations.