none
Store ID from receipt RRS feed

  • Question

  • Hello,

    we are using Unity to develop a new game. Unity is working with in app purchase receipts, which is different to our other apps where we use the collections API to query purchases of a user directly from our servers.

    We are following this guide: https://docs.microsoft.com/en-us/windows/uwp/monetize/use-receipts-to-verify-product-purchases

    It seems that the receipt does not contain the 12 letter Store ID of the inapp purchase, which strikes me as odd. Is there any API to query more details of a purchase for a given receipt so that we could access the Store ID?

    Any help is appreciated!


    • Edited by rewb0rn Thursday, August 22, 2019 9:23 AM
    Thursday, August 22, 2019 9:22 AM

All replies

  • Hi rewb0rn,

    >we use the collections API to query purchases of a user directly from our servers.

    The Windows.ApplicationModel.Store namespace is no longer being updated with new features, and the Microsoft recommends that you use the Windows.Services.Store namespace instead if possible for your app. With Windows.Services.Store, you could use the GetUserCollectionAsync method to get Store product info for add-ons that the current user has purchased, in the result StoreProduct class, you could get the StoreId property. 

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 23, 2019 6:00 AM
    Moderator
  • Hi Daisy,

    thanks for your reply! The question was more about getting the Store ID based on a receipt on our server. We do have access to the Store ID of the product on the client side, however if the client just sends as a receipt and a Store ID this is not trustworthy. Imagine a user sending a valid receipt but a forged Store ID for a much more expensive product. Then we would not be able to identify this, since the signature of the receipt would be valid and we just have to trust the client that this is the correct Store ID. So the question is, is there any server-side way to retrieve a Store ID of a product from a purchase receipt?

    Thanks in advance

    Monday, August 26, 2019 8:44 AM
  • Hi rewb0rn,
    >So the question is, is there any server-side way to retrieve a Store ID of a product from a purchase receipt?
    There probably isn't. There are common three ways to get the Store ID, the third is used a class named StoreProduct which is in the Windows.Services.Store namespace not the Windows.ApplicationModel.Store namespace which you used. With the Windows.ApplicationModel.Store namespace, the product ID is always for used for most operations.

    >a user sending a valid receipt but a forged Store ID for a much more expensive product. 
    Why do users have Store Ids? The document Validating a receipt gives you the way to vaild the receipt. It seems to have nothing to do with Store Ids.

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, August 27, 2019 2:57 AM
    Moderator