XStore operations manipulate information about your game managed by Microsoft Store services.
This page is substantially updated from previous versions.
XStore API testing no longer requires setting up the build to be licensable (for example, contentIdOverride) and for each account to have an entitlement to the game.
When you’re 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 more items result in unexpected query results for the account in both sandboxes. This is because 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 your configured title:Identity
Located in Partner Center under Game setup > Identity details. On PC: Strictly required to match what is assigned to your game in Partner Center. While it isn’t required for console, it should be checked when a package is created for submission to Partner Center.Name in the Identity node needs to match Package/Identity/Name; Publisher in the Identity node needs to match Package/Identity/Publisher.
