Last Updated: 11/1/2022, 2:06:23 PM

# In-App Purchase Integration

# Overview

AccelByte Cloud’s In-app Purchase integration enables you to track player purchases and sync entitlements from 3rd-party platforms such as PlayStation or Xbox. That way, any in-app items that are sold and granted to the player from a 3rd-party platform will also be transferred to our platform, as long as our platform has the proper ID for the item from the platform you’re using. Items that can be sold include coins, bundles, loot boxes, and in-game items, both consumable and durable.

# Supported Platforms

Here’s a table showing the platforms we support, and the features they offer:

3rd Party Login In-App Purchases Entitlements
Apple Y Y N
Epic Online Services Y Y Y
Google Play Y Y N
PlayStation 4 + 5 Y Y Y
Stadia Y Y Y
Steam Y Y Y
Stadia Y Y Y
Twitch Y Y Y
Xbox Live Y Y Y

# Prerequisites

Before creating an In-app Purchase configuration, make sure you are authorized, (opens new window) have registered your clients (opens new window), and have configured 3rd-party login (opens new window) on the selected platform.

# Permissions

Permissions (opens new window) are used to grant access to specific resources within our services. Make sure your account has the following permissions before you attempt to manage In-app Purchase integration in the Admin Portal. For a full list of permissions that impact In-app Purchase management, see the Platform/Commerce tab of the permissions reference (opens new window).

Usage Permission Tag Action Platforms
Retrieve the 3rd-Party Platform Configuration ADMIN:NAMESPACE:{namespace}:IAP:CONFIG READ All platforms
Update the 3rd-Party Platform Configuration ADMIN:NAMESPACE:{namespace}:IAP:CONFIG UPDATE PSN, Xbox, Steam, Stadia, Epic, Twitch, Google Play, Apple

For other supporting permissions such as Synchronizing Entitlement and Updating Business Partner Certificate Files, make sure you have the following permissions.

Usage Permission Tag Action Platforms
Entitlement Synchronization NAMESPACE:{namespace}:USER:{userId}:IAP UPDATE All pPlatforms
Update the Business Partner Certificate File ADMIN:NAMESPACE:{namespace}:IAP:CONFIG UPDATE Xbox, Stadia and Google Play

Permissions work slightly differently depending on whether they are assigned to IAM Clients (opens new window) or Roles (opens new window) assigned to users. For more information, read the Authentication and Authorization (opens new window) documentation.

# Manage In-App Purchase Integration in the Admin Portal

# Add a New Configuration

Follow the steps below to configure 3rd-Party stores in the Admin Portal.

  1. Before beginning, make sure you are in the namespace you want to configure. Go to the E-Commerce section of the main menu in the Admin Portal and select In-app Purchase > 3rd Party Store Integrations.

    NOTE

    Any configurations you make in the publisher namespace will be used as the default configuration for any unconfigured game namespaces.

    iap

  2. Select the platform you wish to configure from the tabs and click Add Configuration.

    iap

    NOTE

    Each namespace can only have one configuration per platform.

  3. Complete the Add Configuration popup. This will be different for each platform.

    # PSN

    iap

    • Select the Environment you wish to work in:
      • sp-int for the development environment
      • prod-qa for the QA environment
      • np for the live environment

    # Xbox

    iap

    # Steam

    Make sure you’ve created an item with the same SKU in both the Steam Store (opens new window) and the AccelByte Platform namespace. Once completed, input the Publisher Authentication Key (opens new window).

    iap

    • Input the game App ID.
    • Input the game Steam Web API Key.

    You can find both of these values in the Steamworks (opens new window) portal.

    # Stadia

    Upload your Stadia Configuration File in .json format.

    iap

    # Epic

    Input the Sandbox ID (opens new window) of your Epic Developers account.

    iap

    # Twitch

    Make sure you’ve completed the following the prerequisites before you begin:

    iap

    # Google Play

    Make sure you’ve created your Android app and set the Product ID (opens new window) to Publish (opens new window) your app in the Google Play store.

    iap

    # Apple

    Make sure you’ve created an item in App Store Connect (opens new window). Use the SKU/Item ID of this item as a Product ID to sync with your App in your namespace’s store.

    iap

    • Input the Bundle ID (opens new window).
    • Input the Password with the App-Specific Shared Secret found in your item’s details in App Store Connect.

Once your configuration is complete, the information you have entered will be visible under the Configuration Details section of the relevant platform. You can also edit or remove configurations on this page.

iap

# Add 3rd-Party Item Mapping

You can use this feature to offer 3rd-party items within your own store via the Admin Portal. Before you set up this feature, make sure that you have created Admin Portal versions of any 3rd-party items you intend to offer using our Cloud Create an Item in a Store (opens new window) guide.

# Add Item Mapping

  1. In your intended game namespace, go to E-Commerce on the left, click In-App Purchase Integration, and select Item Mapping.

iap

  1. The Item Mapping page will appear. In the top, right-hand corner, click on the + Add Item Mapping button.

iap

  1. The Add Item Mapping form will appear. Fill in the following fields:

iap

  • Identity Type: use the dropdown menu to select either SKU or Item ID, based on the field you used when you created the corresponding item in the Admin Portal (opens new window).

  • Item Identity: input the item identity of your corresponding Admin Portal item.

  • Platform name: use the dropdown menu to choose which 3rd-party platform you would like to map your item with. You can use the Add Platform button below to add multiple different 3rd-party platforms.

  • Platform Item Identity: enter the 3rd-party platform’s corresponding item identity. Check the associated 3rd-party’s documentation for more information about their item IDs if you are unsure of where to find this information.

    When you’re finished, click Add to save your mapping.

  1. Your mapping will appear on the Item Mapping page.

iap

A JSON file will also be generated with the data from any mapping you add in this method.

  1. In the upper, right-hand corner, click on the JSON Options button and select Edit.

iap

The generated JSON will appear.

iap

# Add Item Mapping in Bulk via JSON

  1. In your intended game namespace, go to E-Commerce on the left, click In-App Purchase Integration, and select Item Mapping.

iap

  1. The Item Mapping page will appear. In the top, right-hand corner, click on the + Add JSON button.

iap

  1. The Add JSON page will appear with a sample template for item mapping. Delete this sample and replace it with your own JSON data for each item you wish to map.

iap

Below is a copy of the template to write your own item mapping JSON:

[
    {
        "itemIdentity": "<AdminPortalItemSKU>",
        "itemIdentityType": "ITEM_SKU",
        "platformProductIdMap": {
            "EPICGAMES": "<3rdPartyPlatfromItemID>",
            "PLAYSTATION": "<3rdPartyPlatfromItemID>",
            "STADIA": "<3rdPartyPlatfromItemID>",
            "STEAM": "<3rdPartyPlatfromItemID>",
            "XBOX": "<3rdPartyPlatfromItemID>"
        }
    },
    {
        "itemIdentity": "<AdminPortalItemID>",
        "itemIdentityType": "ITEM_ID",
        "platformProductIdMap": {
            "EPICGAMES": "<3rdPartyPlatfromItemID>",
            "PLAYSTATION": "<3rdPartyPlatfromItemID>",
            "STADIA": "<3rdPartyPlatfromItemID>",
            "STEAM": "<3rdPartyPlatfromItemID>",
            "XBOX": "<3rdPartyPlatfromItemID>"
        }
    }
]
  1. When you’re finished, click Save. Your mapping will appear on the Item Mapping page.

iap

# Edit 3rd-Party Item Mapping

You can edit your item mapping at any time, either through the UI or the JSON directly.

# Edit Item Mapping

  1. On the Item Mapping page, find the mapping you want to change and click Edit in that mapping’s Action column.

iap

  1. The Edit Item Mapping form will appear.

iap

Here, you can edit the Platform Item Identity values for each 3rd-party. You can also add 3rd-parties using the Add Platform button or delete them using the bin icon next to the 3rd-party you want to delete. You cannot change the Admin Portal Identity Type or Item Identity. To change this, you must create a new mapping configuration.

When you’re finished, click Save to confirm your changes.

# Edit Item Mapping in Bulk via JSON

  1. On the Item Mapping page, in the upper, right-hand corner, click on the JSON Options button and select Edit.

iap

  1. Your JSON will appear. You can edit the JSON directly in the window or copy and paste from another source.

iap

  1. When you’re finished, click Save to confirm your changes.

# Change Your Business Partner Certificate

  1. In the Admin Portal, go to E-Commerce > In-app Purchase > 3rd Party Store Integrations.

  2. Select the namespace where your certificate belongs.

  3. Under Configuration Details > Business Partner Certificate, click Edit.

    iap

The Change Business Partner Certificate popup will appear.

iap

  • Upload your Business Partner Certificate in .pfx format.
  • Input your Certificate Password. This field is optional. If your certificate requires a password, you must input the password to continue.

# Integrate In-App Purchases using the Client SDKs

# Sync Durable Entitlements

# Epic Games

# Xbox

# 3rd-Party Entitlement Consumption