Microsoft Store: Testing the purchase of your app within the app itself

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.

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.

Notes:

  • 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 Free Trial option.
  • $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.

  1. Publish the app ‘hidden’. i.e. Configure your app so it is not discoverable in the Store.

publish hidden

  1. Set the app price to $0.99 – in a small test market. For example, US Virgin Islands

set price to $0.99 in a small test market

  1. Set the test machine ‘Country or region’ setting to ‘US Virgin Islands’

set region to test market - in this case, 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.

app link in the partner center

Screen Shot of the app with Region setting set to test market (US Virgin Islands in this example). Note $0.99 price:

region == united states

Screen Shot of the app with the Region setting NOT set to test market. Note the normal price.:

region == united states

  1. Use the Free Trial option to acquire the app for the free trial period.

  2. In your, app trigger the code that calls StoreContext.RequestPurchaseAsync to start the purchase flow.

  3. Note that the app is offered at the test price of $0.99.

purchase ui in app

  1. Important: Don’t forget to remove the test market $0.99 price setting before release.
comments powered by Disqus