For the complete documentation index, see llms.txt. This page is also available as Markdown.

Payments

In-game purchases let players buy items, upgrades, or currency. Often the highest-revenue feature for games that fit the IAP model. Enable payments only after ads, storage, and the core game loop are stable.

Two product types

Type
Example
Lifecycle

Permanent

"Remove ads"

Bought once. Use getPurchases() to check ownership on every launch.

Consumable

Coins, gems, energy

Bought, granted, then must be consumed with consumePurchase(id). Until consumed it sits in the purchases list.

Support

Check this before showing the store or purchase buttons. If payments are unsupported, hide the IAP UI or use a non-payment fallback.

Use the PlaygamaBridge Is Payments Supported condition before showing the store or purchase buttons.

Use the PlaygamaBridge Is Payments Supported condition before showing the store or purchase buttons.

Platform support · 10 of 25 platforms

Supports: crazy_games, discord, facebook, huawei, microsoft_store, msn, playgama, portal, reddit, yandex

Does not support: dlightek, game_distribution, gamepush, gamesnacks, jio_games, lagged, ok, poki, samsung, telegram, tiktok, vk, xiaomi, y8, youtube

Setup

Setting up a product takes two steps.

1. List the product ids in the config under the payments key. Each entry needs only an id — the identifier you reference in code:

2. Describe the products in each platform's dashboard. Prices, titles, descriptions, and other product data are not stored in the config — fill them in the developer dashboard of every platform you publish on (Playgama, Yandex, etc.), using the same ids.

If a platform requires a product id that differs from the one in your config, add the platform override next to the product:

Purchase

Start a purchase flow for the product ID from your config. Call this only from a direct player action, such as pressing a buy button.

In the event sheet:

  1. On a trigger (e.g. Button → On clicked), optionally add extra options with Add Action Parameter, then add the Payments Purchase action (parameter: ID).

  2. Add the On Payments Purchase Completed condition. Inside it, when Is Last Action Completed Successfully, read fields with the PlaygamaBridge.PaymentsLastPurchasePropertyValue("id") expression.

Copy This Example

In the events sheet:

  1. On a trigger (e.g. Button is clicked), optionally add extra options with Add Action Parameter, then add the Payments Purchase action (parameter: Id).

  2. Add the On Payments Purchase Completed condition. Inside it, when Is Last Action Completed Successfully, read fields with the PlaygamaBridge::PaymentsLastPurchasePropertyValue("id") expression.

Copy This Example

Each platform returns its own purchase fields. Check the target platform documentation before depending on platform-specific properties.

Use the returned purchase data for backend verification before granting valuable items. Playgama API verification currently supports only playgama, msn, and microsoft_store.

Consume Purchase

Mark a consumable purchase as used after you grant the in-game item. Do not call this for permanent products.

In the event sheet:

  1. On a trigger (e.g. Button → On clicked), add the Payments Consume Purchase action (parameter: ID).

  2. Add the On Payments Consume Purchase Completed condition. Inside it, check Is Last Action Completed Successfully.

Copy This Example

In the events sheet:

  1. On a trigger (e.g. Button is clicked), add the Payments Consume Purchase action (parameter: Id).

  2. Add the On Payments Consume Purchase Completed condition. Inside it, check Is Last Action Completed Successfully.

Copy This Example

Catalog of All Items

Load the product catalog before showing your store. Use it for localized prices, currency codes, and platform-specific product metadata.

In the event sheet:

  1. On a trigger (e.g. Button → On clicked), add the Payments Get Catalog action.

  2. Add the On Payments Get Catalog Completed condition. Inside it, when PlaygamaBridge.PaymentsCatalogItemsCount > 0, loop with System → For from 0 to PaymentsCatalogItemsCount - 1 and read each field with PaymentsCatalogItemPropertyValue(index, "id" / "price" / "priceCurrencyCode" / "priceValue").

Copy This Example

In the events sheet:

  1. On a trigger (e.g. Button is clicked), add the Payments Get Catalog action.

  2. Add the On Payments Get Catalog Completed condition. Inside it, Repeat PlaygamaBridge::PaymentsCatalogItemsCount() times and read each field with PaymentsCatalogItemPropertyValue(index, "id" / "price" / "priceCurrencyCode" / "priceValue").

Copy This Example

List of Purchased Items

Load the player's active purchases on startup and after reconnecting. Use this for permanent ownership checks and unprocessed consumables.

In the event sheet:

  1. On a trigger (e.g. Button → On clicked), add the Payments Get Purchases action.

  2. Add the On Payments Get Purchases Completed condition. Inside it, when PlaygamaBridge.PaymentsPurchasesCount > 0, loop with System → For from 0 to PaymentsPurchasesCount - 1 and read each purchase with PaymentsPurchasePropertyValue(index, "id").

Copy This Example

In the events sheet:

  1. On a trigger (e.g. Button is clicked), add the Payments Get Purchases action.

  2. Add the On Payments Get Purchases Completed condition. Inside it, Repeat PlaygamaBridge::PaymentsPurchasesCount() times and read each purchase with PaymentsPurchasePropertyValue(index, "id").

Copy This Example

Last updated