Integration with PlayFab
How it works
Notice
Supported PlayFab API version: Economy v1 .
- Import a catalog from PlayFab into the In-Game Store to use Xsolla solutions.
- Automatic transfer of items that a user purchases through the In-Game Store to PlayFab.
Who can use it
- Partners who integrated PlayFab and now want to increase items (virtual currency and virtual items) distribution area via Xsolla solutions.
- Partners who integrated Xsolla solutions and now want to monetize their items in PlayFab (sell items for real currency).
Import rules
When importing items from PlayFab, the following logic applies:
- Durable goods from PlayFab are imported as virtual items (not virtual currency nor bundles).
- All items, as well as virtual currency packages and items within a PlayFab bundle, are imported as consumable (parameter
consumable = true
or not specified). - Virtual currency is imported with Partly available status and without a specified price (API flags:
is_show_in_store = false
,is_enabled = true
,is_free = true
). - A bundle containing only one type of virtual currency is imported as a package of virtual currency.
- A bundle containing multiple types of virtual currency is imported as separate virtual currency packages. For each unique combination of SKU and quantity, a free virtual currency package is created with Partly available status (API flags:
is_show_in_store = false
,is_enabled = true
,is_free = true
). - A bundle containing different types of items is imported as a bundle.
- If the Description field for an item is not filled in PlayFab, the Name field is used as the item description; if there is no Name, the SKU is used.
Import limitations
In-Game Store limitations
- Containers and bundles containing containers are not imported.
- DropTables and bundles containing DropTables are not imported.
- Parameters specific to PlayFab, such as
isStackable
,isTradable
,UsageCount
,UsagePeriod
,UsagePeriodGroup
are ignored. - Consumable items are created without considering the quantity (the item disappears from the inventory after the first use).
PlayFab limitations
- PlayFab does not store prices in real currencies. Only preconfigured virtual currency coded as RM (Real money) is used, equivalent to real currency—1 cent (100 RM = 1 USD). Therefore, item prices can only be set in virtual currency or RM.
- Items’ SKUs must be unique and consist of numbers, Latin letters, hyphens and underscores.
How to get it
Import catalog from PlayFab
Note
You’ll need a project ID and a secret project key in PlayFab. Also, the catalog you want to import to Xsolla, should be set up in PlayFab as basic (Base).
If you have not configured PlayFab yet, do the following:
- Create your PlayFab account.
- Create your game.
- Get your unique game Title ID.
- Get your PlayFab Secret key.
Go to Publisher Account and import item catalog from PlayFab to In-Game Store.
Note
You can import virtual items, virtual currency or virtual currency packages.
- Open your Publisher Account and go to Store > Catalog management > Integration with external platforms > PlayFab.
- In the Item import tab specify:
- Title ID — project ID in PlayFab.
- Secret key — the key of the project in PlayFab.
- Click Save.
- Synchronize user inventory with PlayFab (optionally):
- Go to the Inventory synchronization and specify:
- Title ID — project ID in PlayFab.
- Secret key — the key of the project in PlayFab.
- Set the Synchronize user inventory with PlayFab toggle to On.
- Click Save.
- Go to the Inventory synchronization and specify:
- Go to the Item import tab and click Start import. Catalog import will start automatically.
- To sell virtual items in the web store created by Site Builder, configure item groups in Publisher Account and assign one or more of them to each item.
- To display item images, upload them to your Publisher Account.
To check if the import completed successfully, go to the Store section in the side menu and make sure that items, currency, and bundles are enabled on the Virtual currency, Virtual items, and Bundles tabs.
Notice
When you check the import results, please consider that a virtual currency package is a bundle containing only one currency. PlayFab uses virtual currency RM (Real money) which is equivalent to real currency — 1 cent (100 RM = 1 USD). For example, if you import 400 RM from PlayFab, you will see 4 USD in your Publisher Account.
Reimport catalog
When reimporting the catalog, you need to consider that:- Items that are already in the Store will be updated.
- Items that are not available in the Store will be added.
- Items that have already been removed from the source of import will remain in the Store. You can delete them in your Publisher Account or via API.
Add items to the PlayFab inventory
You can set up the adding of items purchased in the Xsolla In-Game Store to your PlayFab inventory in the following ways:- By synchronizing user inventory with PlayFab.
- By integrating PlayFab storage with the Xsolla Login. In this case, PlayFab ID specified in the token. In the case of a return of items on the Xsolla side, a request is sent to PlayFab in the token.
Note
Playfab allows you not to set the name or description of the product. In this case, an empty string is returned in the API calls.
If you want to synchronize user inventory with PlayFab:
- Open your Publisher Account and go to Store > Catalog management > Integration with external platforms > PlayFab.
- Go to the Inventory synchronization and specify:
- Title ID — unique game ID in PlayFab.
- Secret key — the key of the project in PlayFab.
- Set the Synchronize user inventory with PlayFab toggle to On.
- Click Save.
Now information about items purchased in the In-Game Store are automatically transferred to PlayFab.
Was this article helpful?
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.Found a typo or other text error? Select the text and press Ctrl+Enter.