none
How to find out when app was purchased

    Question

  • I have a program I sell that gives the custom 1 year of support and updates. After the year, they can opt to purchase a subscription to continue getting updates. Also, I schedule the Subscription to start 12 months after purchase unless they cancel.

    I see how I could add the subscription as an add-on, but how can I query when the product was purchased or is there an easier way to do this?
    Monday, February 18, 2019 9:58 AM

Answers

  • Hello

    You should be able to get the app receipt using the old API CurrentApp.GetAppReceiptAsync which is an xml string containing information on purchase. Here you can get more information: Use receipts to verify product purchases. (There might be new APIs for that, check Windows.Services.Store namespace)

    For your scenario, 

    1) As long as the app is in trial mode  you don't need to do anything. Just check if it's trial and if so, wait until user purchases the app or it won't be able to use it after 7 days (Windows prevents it if you declare a 7-day trial in your submission).

    2) You can use the purchase date and the information regarding user's subscriptions (there should be similar APIs to get that info) to determine if a user is paid for your subscription and it is not expired. Then you can block new features manually from users with expired subscriptions but as Daisy pointed out, you cannot stop updates from being delivered.



    • Edited by Mehrzadch Friday, February 22, 2019 9:29 AM
    • Marked as answer by realsol31 Sunday, February 24, 2019 4:54 PM
    Friday, February 22, 2019 9:27 AM

All replies

  • Hi realsol31,

    >but how can I query when the product was purchased or is there an easier way to do this?

    The response body in this method may give you some help for the acquire date for the subscription add-on.It is a method in the Microsoft Store purchase API to get the subscription add-ons that a given user has entitlements to use. Please pay attention to the Note in this document.If I misunderstand your issue,please point out.

    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, February 19, 2019 7:46 AM
    Moderator
  • Thank you for responding. This is how the software is currently configured outside of the Windows Store:

    1) Customer installs 7-day trial

    2) Customer purchases app at the end or before the end of the trial

    3) Included in the purchase is a 1-year subscription (1st year, free updates and support subscription)

    4) Currently, outside of the Windows Store, since I know the 'verified' purchase date and 'verified' email, I currently populate a database to keep track of the expiration date of the first scheduled subscription payment (12 months after purchase

    5) At the end of their first year after purchase, the customer has the option to purchase an add-on subscription to continue to get software updates and support.

    6) If they elect NOT to purchase the subscription, they will no longer receive updates but can continue to use the software.

    The best that I can figure, to duplicate this type of licensing, I would need:

    a) to somehow schedule a subscription at the time of the app purchase with their first subscription payment due in 12 months after purchase
    or, query the store for the original purchase date.
    b) I would need something that identifies the user, like a transaction id or email and would need to somehow query the store for this information.
    c) a way to block updates great than a certain date or version number.

    Thank you.

    Tuesday, February 19, 2019 3:51 PM
  • Hi realsol31,

    According to your description, the current in-purchase app can't implement your design. Here are the explanations:

    1. Definition of subscription: A durable add-on where the customer continues to be charged at recurring intervals in order to keep using the add-on.(This add-on cannot be used if the user does not purchase the subscription when it expires).

    2.Microsoft only charges for its own platform, so if you want to keep users buying your product, you need to provide Microsoft with a new product id, which seems unlikely for the same add-on.

    You could submit a feature request in UserVoice ,maybe it will be considered in the future.

    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.

    Thursday, February 21, 2019 9:32 AM
    Moderator
  • Hello

    You should be able to get the app receipt using the old API CurrentApp.GetAppReceiptAsync which is an xml string containing information on purchase. Here you can get more information: Use receipts to verify product purchases. (There might be new APIs for that, check Windows.Services.Store namespace)

    For your scenario, 

    1) As long as the app is in trial mode  you don't need to do anything. Just check if it's trial and if so, wait until user purchases the app or it won't be able to use it after 7 days (Windows prevents it if you declare a 7-day trial in your submission).

    2) You can use the purchase date and the information regarding user's subscriptions (there should be similar APIs to get that info) to determine if a user is paid for your subscription and it is not expired. Then you can block new features manually from users with expired subscriptions but as Daisy pointed out, you cannot stop updates from being delivered.



    • Edited by Mehrzadch Friday, February 22, 2019 9:29 AM
    • Marked as answer by realsol31 Sunday, February 24, 2019 4:54 PM
    Friday, February 22, 2019 9:27 AM
  • Thank you. It sounds like CurrentApp.GetAppReceiptAsync is exactly what I was looking for. 
    Sunday, February 24, 2019 4:57 PM