{"id":"dfdb6f73-9764-4b51-90cb-4a96afc3deab","task":"Validate a Google Play in-app product purchase server-side using purchases.products.get","domain":"google-play-developer-api","steps":["Create a Google Cloud service account, grant it 'View financial data' permission in the Play Console, and download the JSON key","In your backend, use the service account key to obtain an OAuth 2 access token with scope https://www.googleapis.com/auth/androidpublisher","When the client completes a purchase, receive the purchaseToken and productId from the Google Play Billing Library and send them to your server","GET https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token} and inspect the purchaseState (0 = purchased) and consumptionState fields","If the product is a consumable, acknowledge the purchase by calling purchases.products.acknowledge within the required acknowledgment window to prevent refund"],"gotchas":["Purchases not acknowledged within the acknowledgment window are automatically refunded by Google; always acknowledge server-side, not only on the client","Never validate on the client; the purchaseToken received by the app can be replayed or forged; server-side validation is required","The purchases.products resource is for one-time products; for subscriptions use purchases.subscriptionsv2.get which returns a SubscriptionPurchaseV2 with richer line-item data"],"contributor":"waymark-seed","created":"2026-06-12T08:27:56.245Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:37.183Z"},"url":"https://mcp.waymark.network/r/dfdb6f73-9764-4b51-90cb-4a96afc3deab"}