Share via


Implement in-game purchases in your game

This article describes implementing in-game purchases. They are transactions within a game so that players can acquire virtual items or enhance their gaming experience. These purchases can be cosmetic, offering visual customization options like character skins or outfits, or functional, providing in-game advantages such as weapons or power-ups.

Implement in-game purchases by using the Microsoft Game Development Kit and Microsoft Store

To implement player in-game purchases by using the Microsoft Game Development Kit (GDK) APIs and services, follow these steps.

  1. Go to the Apps and games dashboard in Partner Center.
  2. Select your Game product from the list, or use the Search option to search by name or Store ID.
  3. Select Add-ons from the left navigation pane.
  4. Select + Create a new, and then select Consumable or Durable.
  5. Enter an identifier for the item. This will be displayed in the Partner Center UI and referenced in game code.
  6. Integrate with GDK Commerce Systems: Use the Commerce System in the GDK to interact with the platform's (Xbox/Microsoft Store) purchase system. Use the following functions to retrieve product information from the platform's store.
  7. Purchase initiation: The player selects the product they want to purchase from the in-game store. This could be a consumable, durable, subscription, or other types of in-game content. The game initiates the purchase process by using functions like the following:
  8. Manage entitlements: Use the entitlement APIs (XStoreQueryEntitledProductsAsync and XStoreQueryEntitledProductsResult in the GDK to verify and manage player ownership of purchased items. Use the XStoreAcquireLicense APIs for durable products where licenses can be shared.

See also

The GDK documentation is the best source of up-to-date information. For more details see the following articles and samples.