How do I get the Transaction ID for a UWP purchase?

Bryan 26 Reputation points
2021-03-11T02:32:29.603+00:00

Hello,

I am using the RequestPurchaseAsync() method for in-app purchases within our UWP app as documented here: https://learn.microsoft.com/en-us/windows/uwp/monetize/enable-in-app-purchases-of-apps-and-add-ons

I am also using the MS Store Collection API to query the products for a given user as documented here: https://learn.microsoft.com/en-us/windows/uwp/monetize/query-for-products

The CollectionItemContractV6 object response includes a "transactionId" value for these purchases but I do not see where this transaction ID comes from. Where can this ID be found after/during the in-app purchase flow so that we can confirm a transaction matches in our records? Note that I am using the Windows.Services.Store namespace.

Additionally, during the RequestPurchaseAsync() call, we include custom StorePurchaseProperties that uses custom JSON data for the transaction (see https://learn.microsoft.com/en-us/uwp/api/windows.services.store.storepurchaseproperties?view=winrt-19041). How can we retrieve this data after the transaction has completed?

Thanks for any assistance,

Bryan

Microsoft Partner Center
Microsoft Partner Center
A Microsoft website for partners that provides access to product support, a partner community, and other partner services.
870 questions
0 comments No comments
{count} votes

Accepted answer
  1. Roy Li - MSFT 31,551 Reputation points Microsoft Vendor
    2021-03-11T06:08:41.117+00:00

    Hello,

    Welcome to Microsoft Q&A!

    There is no way to get the transaction ID if you are using Windows.Services.Store namespace. If you are using the old Windows.ApplicationModel.Store namespace, you could get the transaction ID in the PurchaseResults object. In the old in-app purchase process using Windows.ApplicationModel.Store namespace, the transaction ID is used to check the product fulfillment for consumable in-app products-Enable consumable in-app product purchases.

    If you are using Windows.Services.Store namespace, there is a different way to check if a user had purchased a project-Get info for add-ons for the current app that the user has purchased. You could check the purchase using the Store API directly without sending it to your own server. Of course, if you need, you could send the purchased product information as you want.

    Thank you.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful