If you’re a Windows developer and you’re using the Free Trial feature of the Microsoft in-app commerce APIs, you may want to offer your users a way to purchase the app before the trial period expires. The most convenient way would be to include a purchase experience from within the app itself. You can implement this by calling the API StoreContext.RequestPurchaseAsync passing in the Store Id. (See below ‘App Identity’.)
To test this scenario at minimum cost, you can temporarily set the price of the app to $0.99 in a single, small market.
- Since you’re testing the Free Trial feature, you can’t set the price to ‘Free’. Setting the price to free, will allow the user to immediately acquire the app without displaying the
- $0.99 (or currency equivalent) is the lowest price setting.
This is done before the app is released to the public. This way you can verify your purchase flow works properly. See the steps below for the step-by-step instructions.
- Publish the app ‘hidden’. i.e. Configure your app so it is not discoverable in the Store.
- Set the app price to $0.99 – in a small test market. For example, US Virgin Islands
- Set the test machine ‘Country or region’ setting to ‘US Virgin Islands’
Use the app link to open the app in the Store app. For example:
ms-windows-store://pdp/?productid=<your product id>. See ‘Product Identity’ for the app in Partner Center.
Screen Shot of the app with Region setting set to test market (US Virgin Islands in this example). Note $0.99 price:
Screen Shot of the app with the Region setting NOT set to test market. Note the normal price.:
Use the Free Trial option to acquire the app for the free trial period.
In your, app trigger the code that calls StoreContext.RequestPurchaseAsync to start the purchase flow.
Note that the app is offered at the test price of $0.99.
- Important: Don’t forget to remove the test market $0.99 price setting before release.