In-Game Purchases

Enable players to purchase items, upgrades, or currency within your game to enhance their experience and generate revenue.

There are two types of purchases: permanent (e.g., ad removal) and consumable (e.g., in-game coins).

Support

Check if in-game purchases are supported to offer items or upgrades within the game.

Setup

Setup in-game purchases in the config file. For each product add an id and fill in the information for the required platforms, example for one product:

{
    ...    
    "payments": [
        {
            "id": "test_product",
            "playgama": {
                "amount": 1 // int price in Gam
            },
            "playdeck": {
                "amount": 1, // int price in Telegram Stars
                "description": "TEST PRODUCT"
            }
        }
    ]
}

Purchase

Allow players to buy items or upgrades in your game to enhance their gameplay experience.

Copy This Example
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"PlaygamaBridge::PaymentsPurchase"},"parameters":["","\"test_product\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnPaymentsPurchaseCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Purchase completed, id:\" + PlaygamaBridge::PaymentsLastPurchasePropertyValue(\"id\")","\"info\"",""]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}

Consume Purchase

Consume purchased items, such as in-game currency, once they are used, to manage inventory and player progression.

Copy This Example
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"PlaygamaBridge::PaymentsConsumePurchase"},"parameters":["","\"test_product\"",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnPaymentsConsumePurchaseCompleted"},"parameters":["",""]}],"actions":[],"events":[{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::IsLastActionCompletedSuccessfully"},"parameters":["",""]}],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Consume completed, id: \" + PlaygamaBridge::PaymentsLastPurchasePropertyValue(\"id\")","\"info\"",""]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}

Catalog of All Items

Retrieve a list of all available in-game items that players can purchase to display in the game store.

Copy Example
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"PlaygamaBridge::PaymentsGetCatalog"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnPaymentsGetCatalogCompleted"},"parameters":["",""]}],"actions":[{"type":{"value":"SetNumberVariable"},"parameters":["loopindex","=","0"]}],"events":[{"type":"BuiltinCommonInstructions::Repeat","repeatExpression":"PlaygamaBridge::PaymentsCatalogItemsCount()","conditions":[],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"ID:\" + PlaygamaBridge::PaymentsCatalogItemPropertyValue(loopindex, \"id\")","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Price:\" + PlaygamaBridge::PaymentsCatalogItemPropertyValue(loopindex, \"price\")","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Price Currency Code:\" + PlaygamaBridge::PaymentsCatalogItemPropertyValue(loopindex, \"priceCurrencyCode\")","\"info\"",""]},{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"Price Value:\" + PlaygamaBridge::PaymentsCatalogItemPropertyValue(loopindex, \"priceValue\")","\"info\"",""]},{"type":{"value":"SetNumberVariable"},"parameters":["loopindex","+","1"]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}

List of Purchased Items

Retrieve a list of items that the player has purchased to manage their inventory and provide access to purchased content.

Copy This Example
{"000kind":"GDEVELOP_EventsAndInstructions_CLIPBOARD_KIND-jsBdHbLy912y8Rc","content":{"eventsList":[{"type":"BuiltinCommonInstructions::Standard","conditions":[],"actions":[{"type":{"value":"PlaygamaBridge::PaymentsGetPurchases"},"parameters":["",""]}]},{"type":"BuiltinCommonInstructions::Standard","conditions":[{"type":{"value":"PlaygamaBridge::OnPaymentsGetPurchasesCompleted"},"parameters":["",""]}],"actions":[{"type":{"value":"SetNumberVariable"},"parameters":["loopindex","=","0"]}],"events":[{"type":"BuiltinCommonInstructions::Repeat","repeatExpression":"PlaygamaBridge::PaymentsPurchasesCount()","conditions":[],"actions":[{"type":{"value":"DebuggerTools::ConsoleLog"},"parameters":["\"ID:\" + PlaygamaBridge::PaymentsPurchasePropertyValue(loopindex, \"id\")","\"info\"",""]},{"type":{"value":"SetNumberVariable"},"parameters":["loopindex","+","1"]}]}]}],"eventsCount":2,"actionsList":[],"actionsCount":0,"conditionsList":[],"conditionsCount":0}}

Last updated