Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.playtolia.com/llms.txt

Use this file to discover all available pages before exploring further.

Methods

MethodParametersReturnsNotes
GetItems()List<StoreItem>
SearchItems(query)stringList<StoreItem>Matches name, description, SKU
GetItemsByType(type)stringList<StoreItem>See item types below
GetItemById(id)stringStoreItem?
GetItemBySku(sku)stringStoreItem?
BeginPurchaseFlow(item, onSuccess?, onError?)StoreItem, Action<PurchaseReceipt>?, Action<PurchaseError>?voidCallbacks are optional
BeginPurchaseFlow(itemId, onSuccess?, onError?)string, Action<PurchaseReceipt>?, Action<PurchaseError>?voidCallbacks are optional
Refresh()void
AddListener(listener)Actionvoid
RemoveListener(listener)Actionvoid

Item types (for GetItemsByType)

"Consumable" · "NonConsumable" · "Subscription"

StoreItem

FieldTypeNotes
Idstring
Namestring
SkustringApp Store / Play Store product ID
Typestring
GrantsGrant[]Rewards granted on purchase

Grant

FieldTypeNotes
GrantIdstringGroups related grants
GrantTypestring
GrantAmountlong
CurrencyCurrency?Non-null for currency grants

PurchaseReceipt

Returned in the onSuccess callback of BeginPurchaseFlow.
FieldTypeNotes
ItemStoreItemThe purchased store item
ReceiptIdstringPlatform transaction ID (Google Play purchase token / App Store transaction ID)
Storestring"google_play" or "apple_app_store"

PurchaseError

Returned in the onError callback of BeginPurchaseFlow.
FieldTypeNotes
CodestringMachine-readable error code (see table below)
MessagestringHuman-readable description
StagestringWhere in the flow the error occurred
ReceiptIdstring?Set when the platform purchase succeeded but verification/acknowledgement failed
ItemIdstring?Playtolia store item ID (if known)
ItemSkustring?Platform SKU (if known)

Purchase error codes

CodeStageDescription
BILLING_UNAVAILABLEPURCHASEPlatform billing is not available on this device
ITEM_NOT_FOUNDPURCHASEStore item ID was not found in the SDK state
USER_CANCELLEDPURCHASEThe user dismissed the purchase dialog
PURCHASE_FAILEDPURCHASEPlatform billing returned an error
VERIFICATION_FAILEDVERIFICATIONBackend purchase verification failed
ACKNOWLEDGEMENT_FAILEDACKNOWLEDGEMENTPlatform acknowledgement failed after successful verification
When Stage is ACKNOWLEDGEMENT, the user has already been charged. The SDK will automatically retry acknowledgement in the background on next app launch. You can reassure the player that their purchase is being processed.