Skip to main content
PlaytoliaStore gives you the product catalog and the purchase flow. It syncs automatically after the player logs in.

Three identifiers, three jobs

Every product carries three identifiers. Confusion between these three identifiers is the most common cause of a product that is null:
If you hardcode a product identifier in your game, the correct identifier is the product code. You cannot change a code after the product is created. This makes the code safe in your build.

Fetching products

Product fields

Id, Code, Name, Description, Sku, Type (Consumable/NonConsumable/Subscription), Grants[] Each Grant has: GrantId, GrantType, GrantAmount, Currency?

Making a purchase

CAUTION: BeginPurchaseFlow(string, ...) takes the Playtolia product ID, not the product code. If the value is one that you typed yourself, use BeginPurchaseFlowByCode instead.
The onSuccess callback receives a PurchaseReceipt with the transaction ID, the store, and the purchased product. The onError callback receives a PurchaseError with a machine-readable error code, a stage, and a message. Both callbacks are optional. When the purchase is successful, the SDK updates the wallet, the entitlements, and the subscriptions of the player automatically.

PurchaseReceipt

PurchaseError

Error codes

CAUTION: The store data is empty until the player signs in. Before login, all product getters return null or an empty list.
When Stage is ACKNOWLEDGEMENT, the platform charged the user, but the acknowledgement failed. The SDK retries automatically at the next app start. A message such as “Your purchase is being processed.” keeps the player informed.

Listening to changes

Wallets

Track currency after purchases

Entitlements

Track non-consumable unlocks