How to Parse Durable Purchase Receipt in UWP
Hi, I have created two add-ons: one is a Durable product, and the other is a Subscription product. I successfully received receipts for both during purchase. As per the documentation, I parsed the receipt for the Subscription product and retrieved the necessary data. However, I am unable to get receipt data for the Durable product. Is there any other way to parse the receipt for a Durable product? Could you please help?
https://zcusa.951200.xyz/en-us/windows/uwp/monetize/get-subscriptions-for-a-user
Universal Windows Platform (UWP)
-
Junjie Zhu - MSFT 19,931 Reputation points • Microsoft Vendor
2025-01-01T09:13:26.6733333+00:00 Hello @Jay ,
Welcome to Microsoft Q&A!
Subscriptions and Durable products are different. By default, durable add-ons never expire, in which case they can only be purchased once. What information do you want to get about Durable products?
Thank you.
-
Jay 140 Reputation points
2025-01-01T09:23:05.9066667+00:00 Yes, that's correct. I have purchased a durable product and received a receipt as mentioned below. I need details such as which product the user has purchased, the purchase date, and other relevant information. Is there any API available to provide such details?
Receipt Details
eyJhbGciOiJSUzI1NiIsImtpZCI6IjM2RDEwMUFGNjdBOUY2MUI4MDE3RkI5NkY5MUVERDRCMjJGMDU4MDQiLCJ4NXQiOiJOdEVCcjJlcDlodUFGX3VXLVI3ZFN5THdXQVEiLCJ0eXAiOiJKV1QifQ.eyJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL21hcmtldHBsYWNlLzIwMTUvMDgvY2xhaW1zL2tleS9jbGllbnRJZCI6ImI4MDBhZjVhLTNjMjgtNGE3Ni1iMWYwLWQ4MGU2NTY3M2UzYSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vbWFya2V0cGxhY2UvMjAxNS8wOC9jbGFpbXMva2V5L3BheWxvYWQiOiJucU8yREpSY1dwQm4wWjJ0TXJYb0VmbTFkQVVJUFpOcytLcGJiRFQ2YWwwZ1A4NFlWY1czUVAzY2lJUDRXK0pqVUdYZEx4NVVNKzB0MWRxNmlDZ3BjUU85Y1lIUFRDMDE1d21BdGFZTmlkU09OWGtZY0IxNTcrTUJ5cEJsYzNUdmNWMGQxWW1icl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5bfgoLtdUXJvJqmc1BTk_OFqpJCN6AXrfIVnPknuHISmB2wNHE6PjQePWVP_V3McFoYQJ0AyGMv9jMSH70X-F18sxeMamX_vkJXQRMI5_n4HysB1uZieCA3yN1_IZmtoolaJQMsxSXHs2vcTqkZDT1u25EyVjp2d5WssZn74TRaHO87ifxcHQWO5ql40w
-
Junjie Zhu - MSFT 19,931 Reputation points • Microsoft Vendor
2025-01-02T02:24:53.22+00:00 Hello @Jay ,
The data you want is usually obtained by Query for products.
The returned data should be a complete json with parameters. How did you get your Durable receipt?
Thank you.
-
Jay 140 Reputation points
2025-01-02T08:54:26.5433333+00:00 How did you get your Durable receipt?
I have obtained this receipt from the following function:
namespace Windows.Services.Store; public extern IAsyncOperation<string> GetCustomerPurchaseIdAsync([In] string serviceTicket, [In] string publisherUserId);
I will check for more details using this link.
-
Jay 140 Reputation points
2025-01-06T07:41:33.6166667+00:00 We used the https://zcusa.951200.xyz/en-us/windows/uwp/monetize/query-for-products to the get details of purchase durable products.
But every time we are facing the below error.
{"code":"Unauthorized","data":[],"details":[],"innererror":{"code":"AuthenticationTokenInvalid","data":["B2B key"],"details":[],"message":"Authentication token supplied is invalid"},"message":"The client is not authorized to perform the requested operation.","source":"CollectionsFD"}
Request Array of PHP as per below.
$data = [ "beneficiaries" => [ [ "localTicketReference" => "1055521810674918", "identityValue" => "eyJhbGciOiJSUzI1NiIsImtpZCI6IjM2RDEwMUFGNjdBOUY2MUI4MDE3RkI5NkY5MUVERDRCMjJGMDU4MDQiLCJ4NXQiOiJOdEVCcjJlcDlodUFGX3VXLVI3ZFN5THdXQVEiLCJ0eXAiOiJKV1QifQ.eyJodHRwOi8vc2NoZW1hcy5taWNyb3NvZnQuY29tL21hcmtldHBsYWNlLzIwMTUvMDgvY2xhaW1zL2tleS9jbGllbnRJZCI6ImI4MDBhZjVhLTNjMjgtNGE3Ni1iMWYwLWQ4MGU2NTY3M2UzYSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5j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3Y2LjAva2V5cyIsImF1ZCI6Imh0dHBzOi8vcHVyY2hhc2UubXAubWljcm9zb2Z0LmNvbS92Ni4wL2tleXMifQ.rPYKP0KtSnlUPF4gWh3LTkKDqN6pUL6xFHS_7x6M4E2nwnzk0Ie9uIsWVFi77LsXzWOBqkh0rkNY8akN--ypPO_iZyR2-QcPxITRKSL8-n9MuqpapVVVg4AmVz_DXUEsYPqeLEsx_8EdUit-xeOJsF_qPIdFtHFd-uTZn8gi4Z979dyrIKaparoSzYo-1HBE1CVNQjb9YyMSyUmkb3zsu4YPUpU4VA81kYn_Q5ubG1Dt_dOahYQGi7yL2-yul6hwOCEiZt0JC31xy4ohtJiqJic2ZnXYaX1_K6EaT0z5DaVQgi5J3ZPbYFDpGAE1ogAULslbHaTewgbcacV7C3OfLQ", "identityType" => "b2b" ] ], "productSkuIds" => [ [ "productId" => "9PFWPW469DLG", "skuId" => "0100" ] ], "productTypes" => ["Durable"], "validityType" => "All" ];
So what is issue in this please suggest us so we can solve.
Note : If we use this b2b key with subscription API https://zcusa.951200.xyz/en-us/windows/uwp/monetize/get-subscriptions-for-a-user. Get the response as per below.
"{"items":[]}
Thank You
-
Junjie Zhu - MSFT 19,931 Reputation points • Microsoft Vendor
2025-01-06T08:47:29.27+00:00 Hello @Jay ,
For your scenario, I suggest that you might need to open a support ticket for this. Please contact our paid support at MS Support.
You will get 1:1 support on that. Select Developer Tools -> Windows UWP Development -> Windows 10 Universal App Dev -> Runtime Platform in the support page and you could contact the team. Please kindly note that your support ticket will be free if it is Microsoft's issue.
Thank you.
-
Jay 140 Reputation points
2025-01-07T10:39:35.09+00:00 Hello @Junjie Zhu - MSFT
Thank you for your suggestion
Sign in to comment