Install the required Unity packages, create add-ons in Microsoft Partner Center, and configure Unity Editor settings to prepare your Unity project for Xbox Store purchases.
Before you implement in-app purchases, verify your project meets the following requirements:
Development environment:
Unity packages:
Install the following packages:
Before implementing in-app purchases, verify the following configurations in Microsoft Partner Center:
For more information, refer to the Microsoft documentation on Product setup.
Note: Sandbox environments don’t support subscription testing. Subscriptions don’t display in Xbox account settings, which prevents renewal or cancellation.
To enable Microsoft Store Services, go to Product collections and purchases, and enter the client ID of your game back end.
Add-ons represent the products you want to sell in your game.
Go to Add-ons and create add-ons that match the product types in the IAP package.
| IAP ProductType | Microsoft Partner Center Add-on | XStoreProductKind |
|---|---|---|
| Consumable | Consumable (Developer-managed) | UnmanagedConsumable |
| Non-Consumable | Durable | Durable |
| Subscription | Subscription | Durable (EndDate property is set) |
Note: The XStoreProductKind is included for reference only. Use the ProductType enum in your Unity code.
For each add-on, configure the following settings:
In the Identity details section, note the Store ID for each add-on.
Configure Microsoft GDK packages and enable Unity IAPAbbreviation of Unity In App Purchase
See in Glossary to prepare your project for Xbox Store integration.
In the Unity Editor, go to Project Settings > Microsoft GDK and enable Build for Microsoft GDK for each target platform.
Ensure a GDK Settings asset is active, and configure the Microsoft Game Config asset with IDs that match the ones in Microsoft Partner Center.
Go to Project Settings > Player > Other Settings and verify that the Scripting Define Symbols includes MICROSOFT_GDK_SUPPORT.
Note: This symbol is set automatically when you enable Build for Microsoft GDK in Project Settings > Microsoft GDK.
After completing the Microsoft Partner Center and Unity Editor configuration, implement the purchase workflow in your Unity code.