How It Works
WhensyncPlayPurchases is enabled (the default), the SDK automatically:
- Installs a
PurchasesUpdatedListenerand connects to Google Play Billing - Forwards every completed Play purchase to your ZeroSettle backend (
POST /v1/iap/play-store-transactions/) - Merges Play Store entitlements with web checkout entitlements
- Acknowledges purchases per the acknowledgement model described below, retrying failed syncs via a persistent sync queue
ZeroSettle.entitlements — alongside their web checkout purchases.
Configuration
Play purchase sync is enabled by default:User Choice Billing
If your app and market are enrolled in Google’s User Choice Billing (UCB), the SDK exposes aStateFlow you can use to adapt your purchase UI:
isUcbEnabled is tenant- and market-scoped — it resets on configure(), not on logout(), and starts false until identify() completes bootstrap.
Purchasing via Play Billing
UsepurchaseViaPlayBilling() to trigger a native Play Billing purchase. Like purchase(), it is awaitable and returns a Result<CheckoutTransaction>. Requires syncPlayPurchases = true.
Hybrid Purchase Flow
A common pattern is to offer web checkout as the primary option with Play Billing as a fallback:Product model carries Play-specific fields (all nullable, populated when the product is configured in Google Play Console):
product.playProductId— the Play Console product idproduct.playBasePlanId— the Play base plan id (subscriptions)product.playStorePrice— the Google Play price from your synced Play catalog,nulluntil the product is linked to a Play product with a price
Sync Events
WhensyncPlayPurchases is enabled, the SDK syncs Play purchases automatically. Observe sync outcomes via ZeroSettle.events — there is no delegate interface on Android:
Sync failures don’t affect the Play purchase itself. The user still gets their purchase through Google. The sync is retried automatically via the SDK’s persistent sync queue.
Entitlement Sources
Entitlements track where each purchase came from:Cross-account ownership conflicts
If a Play purchase is already owned by a different ZeroSettle account, the SDK does not silently transfer it. It surfaces aPendingClaim on ZeroSettle.pendingClaims; the host app resolves it explicitly with ZeroSettle.transferPlayOwnershipToCurrentUser(productId).
Account tokens and obfuscatedAccountId
When a user is signed in, the Android SDK sets obfuscatedAccountId on the Play purchase to an account token derived from that user. If the purchase is later synced under a different signed-in user, ZeroSettle re-attributes it to the token’s user only when that user has synced before and the purchase has no owner yet. Otherwise the usual claim flow applies. Do not set your own obfuscatedAccountId when you use the ZeroSettle Android SDK.
One-time products you haven’t linked yet
If a customer buys a Google Play one-time product that isn’t linked to a product in your ZeroSettle catalog, ZeroSettle can’t tell whether it’s a consumable or a non-consumable. It records the purchase and its revenue but grants no lasting access, so a consumable pack never turns into permanent access by mistake. The sync call answersowned: true with no entitlementId, and the SDK acknowledges the purchase as usual.
The dashboard’s catalog sheet shows how many purchases are waiting on each unlinked product. When you link it, ZeroSettle finishes those purchases: a non-consumable grants access to each buyer, and a consumable needs nothing more.
Acknowledgement model
Google Play refunds a purchase that is not acknowledged within 3 days, so the order in which the SDK finalizes a purchase matters. The SDK acknowledges non-consumables and subscriptions, and consumes consumables so the buyer can purchase them again.
Set
strictAck = true in ZeroSettleConfig only if you would rather risk an auto-refund than ever acknowledge an unvalidated purchase.
Requirements
Next Steps
Quickstart (Android)
Full Android setup guide
User Identity
How to identify users across purchases
