Compartir a través de


Enabling XStore development and testing

Games will use the XStore APIs to perform operations on the licenses and entitlements that are associated with your game and its related products (e.g. add-ons). Many of the XStore operations manipulate information about your game that's managed by Microsoft Store services.

Note

This page has been substantially updated from previous versions. As of June 2023, most* XStore API testing no longer requires setting up the build to be licensable (e.g. contentIdOverride) and for each account to have an entitlement to the game.

When testing commerce in development sandboxes, all purchases on a single test account must be done in the same sandbox. Switching a test account to another sandbox and purchasing additional items will result in unexpected query results for the account in both sandboxes. This is due to the fact that the licenses and information of a purchase are tied to the first sandbox the item was purchased in for a single account.

When testing commerce in development sandboxes on PC, make sure that the account signed into the Microsoft Store App and the Xbox app are the same. When in sandboxes, the credentials used for items in the Microsoft Store are tied to the Xbox account specifically. This is critical to ensure all operations interact with products published specifically to the active sandbox. See Handling mismatched store account scenarios on PC for more info.

In order to test most* XStore API, ensure the game config contains the proper values derived from Partner Center.

* API related to licensing, such as XStoreQueryGameLicenseAsync, will require a fully licensed context to function properly. See Enabling license testing for complete details.

Apply game IDs to MicrosoftGameConfig

First, publish your game and add-ons on Partner Center.

Then in the game's config file ensure the values match those of your configured title:

  <Identity
    Name="41336MicrosoftATG.InGameStoreXS"
    Publisher="CN=A4954634-DF4B-47C7-AB70-D3215D246AF1"
    Version="2023.5.5.0" />
  <StoreId>9NTL0QDWZ4FS</StoreId>
  <MSAAppId>000000004C2690C8</MSAAppId>
  <TitleId>62ab3c24</TitleId>

Identity

This is in Partner Center under Game setup > Identity details.

On PC: This is strictly required to match what is assigned to your game in Partner Center.

While it is not required for console, in practice it should be as it will be checked when a package is created for submission to Partner Center.

Game setup > Identity details with Package/Identity/Name and Publisher circled

Name in the Identity node needs to match Package/Identity/Name; Publisher in the Identity node needs to match Package/Identity/Publisher.

StoreID

This also can be found in Game setup > Identity details

Game setup > Identity details with StoreId circled in URL and on page

See also

Commerce Overview

Initial configuration in Partner Center

Enabling license testing

Switching sandboxes properly for Store operations

XStore API reference