Validate Windows Store Receipt
NOTE: This is a Legacy Economy API, and is in bugfix-only mode. All new Economy features are being developed only for version 2. Validates with Windows that the receipt for an Windows App Store in-app purchase is valid and that it matches the purchased catalog item
Error codes
This operation may return the following PlayFab errors:
| Error | Code |
|---|---|
| InvalidReceipt | 1021 |
| MissingAmazonSharedKey | 1149 |
| NoMatchingCatalogItemForReceipt | 1178 |
| ProductDisabledForTitle | 1609 |
| ReceiptAlreadyUsed | 1022 |
curl --request POST \
--url https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"Receipt": "<Receipt Version=\"1.0\" ReceiptDate=\"2012-08-30T23:10:05Z\" CertificateId=\"b809e47cd0110a4db043b3f73e83acd917fe1336\" ReceiptDeviceId=\"4e362949-acc3-fe3a-e71b-89893eb4f528\">\r\n <AppReceipt Id=\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\" AppId=\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\" PurchaseDate=\"2012-06-04T23:07:24Z\" LicenseType=\"Full\" />\r\n <ProductReceipt Id=\"6bbf4366-6fb2-8be8-7947-92fd5f683530\" ProductId=\"Product1\" PurchaseDate=\"2012-08-30T23:08:52Z\" ExpirationDate=\"2012-09-02T23:08:49Z\" ProductType=\"Durable\" AppId=\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\" />\r\n <Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">\r\n <SignedInfo>\r\n <CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />\r\n <SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\" />\r\n <Reference URI=\"\">\r\n <Transforms>\r\n <Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\" />\r\n </Transforms>\r\n <DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\" />\r\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\r\n </Reference>\r\n </SignedInfo>\r\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\r\n </Signature>\r\n</Receipt>\r\n"
}
'import requests
url = "https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt"
payload = { "Receipt": "<Receipt Version=\"1.0\" ReceiptDate=\"2012-08-30T23:10:05Z\" CertificateId=\"b809e47cd0110a4db043b3f73e83acd917fe1336\" ReceiptDeviceId=\"4e362949-acc3-fe3a-e71b-89893eb4f528\">
<AppReceipt Id=\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\" AppId=\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\" PurchaseDate=\"2012-06-04T23:07:24Z\" LicenseType=\"Full\" />
<ProductReceipt Id=\"6bbf4366-6fb2-8be8-7947-92fd5f683530\" ProductId=\"Product1\" PurchaseDate=\"2012-08-30T23:08:52Z\" ExpirationDate=\"2012-09-02T23:08:49Z\" ProductType=\"Durable\" AppId=\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\" />
<Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">
<SignedInfo>
<CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />
<SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\" />
<Reference URI=\"\">
<Transforms>
<Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\" />
</Transforms>
<DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\" />
<DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>
</Signature>
</Receipt>
" }
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Receipt: '<Receipt Version="1.0" ReceiptDate="2012-08-30T23:10:05Z" CertificateId="b809e47cd0110a4db043b3f73e83acd917fe1336" ReceiptDeviceId="4e362949-acc3-fe3a-e71b-89893eb4f528">\r\n <AppReceipt Id="8ffa256d-eca8-712a-7cf8-cbf5522df24b" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" PurchaseDate="2012-06-04T23:07:24Z" LicenseType="Full" />\r\n <ProductReceipt Id="6bbf4366-6fb2-8be8-7947-92fd5f683530" ProductId="Product1" PurchaseDate="2012-08-30T23:08:52Z" ExpirationDate="2012-09-02T23:08:49Z" ProductType="Durable" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" />\r\n <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">\r\n <SignedInfo>\r\n <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />\r\n <SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />\r\n <Reference URI="">\r\n <Transforms>\r\n <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />\r\n </Transforms>\r\n <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />\r\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\r\n </Reference>\r\n </SignedInfo>\r\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\r\n </Signature>\r\n</Receipt>\r\n'
})
};
fetch('https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Receipt' => '<Receipt Version="1.0" ReceiptDate="2012-08-30T23:10:05Z" CertificateId="b809e47cd0110a4db043b3f73e83acd917fe1336" ReceiptDeviceId="4e362949-acc3-fe3a-e71b-89893eb4f528">
<AppReceipt Id="8ffa256d-eca8-712a-7cf8-cbf5522df24b" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" PurchaseDate="2012-06-04T23:07:24Z" LicenseType="Full" />
<ProductReceipt Id="6bbf4366-6fb2-8be8-7947-92fd5f683530" ProductId="Product1" PurchaseDate="2012-08-30T23:08:52Z" ExpirationDate="2012-09-02T23:08:49Z" ProductType="Durable" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" />
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>
</Signature>
</Receipt>
'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt"
payload := strings.NewReader("{\n \"Receipt\": \"<Receipt Version=\\\"1.0\\\" ReceiptDate=\\\"2012-08-30T23:10:05Z\\\" CertificateId=\\\"b809e47cd0110a4db043b3f73e83acd917fe1336\\\" ReceiptDeviceId=\\\"4e362949-acc3-fe3a-e71b-89893eb4f528\\\">\\r\\n <AppReceipt Id=\\\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" PurchaseDate=\\\"2012-06-04T23:07:24Z\\\" LicenseType=\\\"Full\\\" />\\r\\n <ProductReceipt Id=\\\"6bbf4366-6fb2-8be8-7947-92fd5f683530\\\" ProductId=\\\"Product1\\\" PurchaseDate=\\\"2012-08-30T23:08:52Z\\\" ExpirationDate=\\\"2012-09-02T23:08:49Z\\\" ProductType=\\\"Durable\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" />\\r\\n <Signature xmlns=\\\"http://www.w3.org/2000/09/xmldsig#\\\">\\r\\n <SignedInfo>\\r\\n <CanonicalizationMethod Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" />\\r\\n <SignatureMethod Algorithm=\\\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\\\" />\\r\\n <Reference URI=\\\"\\\">\\r\\n <Transforms>\\r\\n <Transform Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\\\" />\\r\\n </Transforms>\\r\\n <DigestMethod Algorithm=\\\"http://www.w3.org/2001/04/xmlenc#sha256\\\" />\\r\\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\\r\\n </Reference>\\r\\n </SignedInfo>\\r\\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\\r\\n </Signature>\\r\\n</Receipt>\\r\\n\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Receipt\": \"<Receipt Version=\\\"1.0\\\" ReceiptDate=\\\"2012-08-30T23:10:05Z\\\" CertificateId=\\\"b809e47cd0110a4db043b3f73e83acd917fe1336\\\" ReceiptDeviceId=\\\"4e362949-acc3-fe3a-e71b-89893eb4f528\\\">\\r\\n <AppReceipt Id=\\\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" PurchaseDate=\\\"2012-06-04T23:07:24Z\\\" LicenseType=\\\"Full\\\" />\\r\\n <ProductReceipt Id=\\\"6bbf4366-6fb2-8be8-7947-92fd5f683530\\\" ProductId=\\\"Product1\\\" PurchaseDate=\\\"2012-08-30T23:08:52Z\\\" ExpirationDate=\\\"2012-09-02T23:08:49Z\\\" ProductType=\\\"Durable\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" />\\r\\n <Signature xmlns=\\\"http://www.w3.org/2000/09/xmldsig#\\\">\\r\\n <SignedInfo>\\r\\n <CanonicalizationMethod Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" />\\r\\n <SignatureMethod Algorithm=\\\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\\\" />\\r\\n <Reference URI=\\\"\\\">\\r\\n <Transforms>\\r\\n <Transform Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\\\" />\\r\\n </Transforms>\\r\\n <DigestMethod Algorithm=\\\"http://www.w3.org/2001/04/xmlenc#sha256\\\" />\\r\\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\\r\\n </Reference>\\r\\n </SignedInfo>\\r\\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\\r\\n </Signature>\\r\\n</Receipt>\\r\\n\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Receipt\": \"<Receipt Version=\\\"1.0\\\" ReceiptDate=\\\"2012-08-30T23:10:05Z\\\" CertificateId=\\\"b809e47cd0110a4db043b3f73e83acd917fe1336\\\" ReceiptDeviceId=\\\"4e362949-acc3-fe3a-e71b-89893eb4f528\\\">\\r\\n <AppReceipt Id=\\\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" PurchaseDate=\\\"2012-06-04T23:07:24Z\\\" LicenseType=\\\"Full\\\" />\\r\\n <ProductReceipt Id=\\\"6bbf4366-6fb2-8be8-7947-92fd5f683530\\\" ProductId=\\\"Product1\\\" PurchaseDate=\\\"2012-08-30T23:08:52Z\\\" ExpirationDate=\\\"2012-09-02T23:08:49Z\\\" ProductType=\\\"Durable\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" />\\r\\n <Signature xmlns=\\\"http://www.w3.org/2000/09/xmldsig#\\\">\\r\\n <SignedInfo>\\r\\n <CanonicalizationMethod Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" />\\r\\n <SignatureMethod Algorithm=\\\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\\\" />\\r\\n <Reference URI=\\\"\\\">\\r\\n <Transforms>\\r\\n <Transform Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\\\" />\\r\\n </Transforms>\\r\\n <DigestMethod Algorithm=\\\"http://www.w3.org/2001/04/xmlenc#sha256\\\" />\\r\\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\\r\\n </Reference>\\r\\n </SignedInfo>\\r\\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\\r\\n </Signature>\\r\\n</Receipt>\\r\\n\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"status": "OK",
"data": {
"Fulfillments": [
{
"FulfilledItems": [
{
"ItemId": "shield_level_5",
"ItemInstanceId": "A1437F80BE99D3E8",
"ItemClass": "shields",
"PurchaseDate": "2019-03-07T00:00:00",
"Expiration": "2020-10-01T00:00:00",
"RemainingUses": 10,
"CatalogVersion": "5"
}
]
}
]
}
}{
"code": 123,
"errorCode": 123,
"status": "<string>",
"error": "<string>",
"errorMessage": "<string>",
"errorDetails": {}
}Authorizations
This API requires a client session ticket, available from any Client Login function.
Body
Currency used to pay for the purchase (ISO 4217 currency code).
Amount of the stated currency paid, in centesimal units.
XML Receipt returned by the Windows App Store in-app purchase API
Catalog version of the fulfilled items. If null, defaults to the primary catalog.
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
Response
Once verified, the catalog item matching the Product name will be added to the user's inventory. This result should be used for immediate updates to the local client game state as opposed to the GetUserInventory API which can have an up to half second delay.
The Http status code. If X-ReportErrorAsSuccess header is set to true, this will report the actual http error code.
The Http status code as a string.
Once verified, the catalog item matching the Product name will be added to the user's inventory. This result should be used for immediate updates to the local client game state as opposed to the GetUserInventory API which can have an up to half second delay.
Show child attributes
Show child attributes
{
"Fulfillments": [
{
"FulfilledItems": [
{
"ItemId": "shield_level_5",
"ItemInstanceId": "A1437F80BE99D3E8",
"ItemClass": "shields",
"PurchaseDate": "2019-03-07T00:00:00",
"Expiration": "2020-10-01T00:00:00",
"RemainingUses": 10,
"CatalogVersion": "5"
}
]
}
]
}
Was this page helpful?
curl --request POST \
--url https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt \
--header 'Content-Type: application/json' \
--header 'X-Authorization: <api-key>' \
--data '
{
"Receipt": "<Receipt Version=\"1.0\" ReceiptDate=\"2012-08-30T23:10:05Z\" CertificateId=\"b809e47cd0110a4db043b3f73e83acd917fe1336\" ReceiptDeviceId=\"4e362949-acc3-fe3a-e71b-89893eb4f528\">\r\n <AppReceipt Id=\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\" AppId=\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\" PurchaseDate=\"2012-06-04T23:07:24Z\" LicenseType=\"Full\" />\r\n <ProductReceipt Id=\"6bbf4366-6fb2-8be8-7947-92fd5f683530\" ProductId=\"Product1\" PurchaseDate=\"2012-08-30T23:08:52Z\" ExpirationDate=\"2012-09-02T23:08:49Z\" ProductType=\"Durable\" AppId=\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\" />\r\n <Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">\r\n <SignedInfo>\r\n <CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />\r\n <SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\" />\r\n <Reference URI=\"\">\r\n <Transforms>\r\n <Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\" />\r\n </Transforms>\r\n <DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\" />\r\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\r\n </Reference>\r\n </SignedInfo>\r\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\r\n </Signature>\r\n</Receipt>\r\n"
}
'import requests
url = "https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt"
payload = { "Receipt": "<Receipt Version=\"1.0\" ReceiptDate=\"2012-08-30T23:10:05Z\" CertificateId=\"b809e47cd0110a4db043b3f73e83acd917fe1336\" ReceiptDeviceId=\"4e362949-acc3-fe3a-e71b-89893eb4f528\">
<AppReceipt Id=\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\" AppId=\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\" PurchaseDate=\"2012-06-04T23:07:24Z\" LicenseType=\"Full\" />
<ProductReceipt Id=\"6bbf4366-6fb2-8be8-7947-92fd5f683530\" ProductId=\"Product1\" PurchaseDate=\"2012-08-30T23:08:52Z\" ExpirationDate=\"2012-09-02T23:08:49Z\" ProductType=\"Durable\" AppId=\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\" />
<Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">
<SignedInfo>
<CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" />
<SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\" />
<Reference URI=\"\">
<Transforms>
<Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\" />
</Transforms>
<DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\" />
<DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>
</Signature>
</Receipt>
" }
headers = {
"X-Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Authorization': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
Receipt: '<Receipt Version="1.0" ReceiptDate="2012-08-30T23:10:05Z" CertificateId="b809e47cd0110a4db043b3f73e83acd917fe1336" ReceiptDeviceId="4e362949-acc3-fe3a-e71b-89893eb4f528">\r\n <AppReceipt Id="8ffa256d-eca8-712a-7cf8-cbf5522df24b" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" PurchaseDate="2012-06-04T23:07:24Z" LicenseType="Full" />\r\n <ProductReceipt Id="6bbf4366-6fb2-8be8-7947-92fd5f683530" ProductId="Product1" PurchaseDate="2012-08-30T23:08:52Z" ExpirationDate="2012-09-02T23:08:49Z" ProductType="Durable" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" />\r\n <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">\r\n <SignedInfo>\r\n <CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />\r\n <SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />\r\n <Reference URI="">\r\n <Transforms>\r\n <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />\r\n </Transforms>\r\n <DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />\r\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\r\n </Reference>\r\n </SignedInfo>\r\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\r\n </Signature>\r\n</Receipt>\r\n'
})
};
fetch('https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'Receipt' => '<Receipt Version="1.0" ReceiptDate="2012-08-30T23:10:05Z" CertificateId="b809e47cd0110a4db043b3f73e83acd917fe1336" ReceiptDeviceId="4e362949-acc3-fe3a-e71b-89893eb4f528">
<AppReceipt Id="8ffa256d-eca8-712a-7cf8-cbf5522df24b" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" PurchaseDate="2012-06-04T23:07:24Z" LicenseType="Full" />
<ProductReceipt Id="6bbf4366-6fb2-8be8-7947-92fd5f683530" ProductId="Product1" PurchaseDate="2012-08-30T23:08:52Z" ExpirationDate="2012-09-02T23:08:49Z" ProductType="Durable" AppId="55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr" />
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2001/04/xmldsig-more#rsa-sha256" />
<Reference URI="">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2001/04/xmlenc#sha256" />
<DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>
</Signature>
</Receipt>
'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt"
payload := strings.NewReader("{\n \"Receipt\": \"<Receipt Version=\\\"1.0\\\" ReceiptDate=\\\"2012-08-30T23:10:05Z\\\" CertificateId=\\\"b809e47cd0110a4db043b3f73e83acd917fe1336\\\" ReceiptDeviceId=\\\"4e362949-acc3-fe3a-e71b-89893eb4f528\\\">\\r\\n <AppReceipt Id=\\\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" PurchaseDate=\\\"2012-06-04T23:07:24Z\\\" LicenseType=\\\"Full\\\" />\\r\\n <ProductReceipt Id=\\\"6bbf4366-6fb2-8be8-7947-92fd5f683530\\\" ProductId=\\\"Product1\\\" PurchaseDate=\\\"2012-08-30T23:08:52Z\\\" ExpirationDate=\\\"2012-09-02T23:08:49Z\\\" ProductType=\\\"Durable\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" />\\r\\n <Signature xmlns=\\\"http://www.w3.org/2000/09/xmldsig#\\\">\\r\\n <SignedInfo>\\r\\n <CanonicalizationMethod Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" />\\r\\n <SignatureMethod Algorithm=\\\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\\\" />\\r\\n <Reference URI=\\\"\\\">\\r\\n <Transforms>\\r\\n <Transform Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\\\" />\\r\\n </Transforms>\\r\\n <DigestMethod Algorithm=\\\"http://www.w3.org/2001/04/xmlenc#sha256\\\" />\\r\\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\\r\\n </Reference>\\r\\n </SignedInfo>\\r\\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\\r\\n </Signature>\\r\\n</Receipt>\\r\\n\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt")
.header("X-Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"Receipt\": \"<Receipt Version=\\\"1.0\\\" ReceiptDate=\\\"2012-08-30T23:10:05Z\\\" CertificateId=\\\"b809e47cd0110a4db043b3f73e83acd917fe1336\\\" ReceiptDeviceId=\\\"4e362949-acc3-fe3a-e71b-89893eb4f528\\\">\\r\\n <AppReceipt Id=\\\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" PurchaseDate=\\\"2012-06-04T23:07:24Z\\\" LicenseType=\\\"Full\\\" />\\r\\n <ProductReceipt Id=\\\"6bbf4366-6fb2-8be8-7947-92fd5f683530\\\" ProductId=\\\"Product1\\\" PurchaseDate=\\\"2012-08-30T23:08:52Z\\\" ExpirationDate=\\\"2012-09-02T23:08:49Z\\\" ProductType=\\\"Durable\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" />\\r\\n <Signature xmlns=\\\"http://www.w3.org/2000/09/xmldsig#\\\">\\r\\n <SignedInfo>\\r\\n <CanonicalizationMethod Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" />\\r\\n <SignatureMethod Algorithm=\\\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\\\" />\\r\\n <Reference URI=\\\"\\\">\\r\\n <Transforms>\\r\\n <Transform Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\\\" />\\r\\n </Transforms>\\r\\n <DigestMethod Algorithm=\\\"http://www.w3.org/2001/04/xmlenc#sha256\\\" />\\r\\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\\r\\n </Reference>\\r\\n </SignedInfo>\\r\\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\\r\\n </Signature>\\r\\n</Receipt>\\r\\n\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{titleId}.playfabapi.com/Client/ValidateWindowsStoreReceipt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"Receipt\": \"<Receipt Version=\\\"1.0\\\" ReceiptDate=\\\"2012-08-30T23:10:05Z\\\" CertificateId=\\\"b809e47cd0110a4db043b3f73e83acd917fe1336\\\" ReceiptDeviceId=\\\"4e362949-acc3-fe3a-e71b-89893eb4f528\\\">\\r\\n <AppReceipt Id=\\\"8ffa256d-eca8-712a-7cf8-cbf5522df24b\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" PurchaseDate=\\\"2012-06-04T23:07:24Z\\\" LicenseType=\\\"Full\\\" />\\r\\n <ProductReceipt Id=\\\"6bbf4366-6fb2-8be8-7947-92fd5f683530\\\" ProductId=\\\"Product1\\\" PurchaseDate=\\\"2012-08-30T23:08:52Z\\\" ExpirationDate=\\\"2012-09-02T23:08:49Z\\\" ProductType=\\\"Durable\\\" AppId=\\\"55428GreenlakeApps.CurrentAppSimulatorEventTest_z7q3q7z11crfr\\\" />\\r\\n <Signature xmlns=\\\"http://www.w3.org/2000/09/xmldsig#\\\">\\r\\n <SignedInfo>\\r\\n <CanonicalizationMethod Algorithm=\\\"http://www.w3.org/2001/10/xml-exc-c14n#\\\" />\\r\\n <SignatureMethod Algorithm=\\\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\\\" />\\r\\n <Reference URI=\\\"\\\">\\r\\n <Transforms>\\r\\n <Transform Algorithm=\\\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\\\" />\\r\\n </Transforms>\\r\\n <DigestMethod Algorithm=\\\"http://www.w3.org/2001/04/xmlenc#sha256\\\" />\\r\\n <DigestValue>cdiU06eD8X/w1aGCHeaGCG9w/kWZ8I099rw4mmPpvdU=</DigestValue>\\r\\n </Reference>\\r\\n </SignedInfo>\\r\\n <SignatureValue>SjRIxS/2r2P6ZdgaR9bwUSa6ZItYYFpKLJZrnAa3zkMylbiWjh9oZGGng2p6/gtBHC2dSTZlLbqnysJjl7mQp/A3wKaIkzjyRXv3kxoVaSV0pkqiPt04cIfFTP0JZkE5QD/vYxiWjeyGp1dThEM2RV811sRWvmEs/hHhVxb32e8xCLtpALYx3a9lW51zRJJN0eNdPAvNoiCJlnogAoTToUQLHs72I1dECnSbeNPXiG7klpy5boKKMCZfnVXXkneWvVFtAA1h2sB7ll40LEHO4oYN6VzD+uKd76QOgGmsu9iGVyRvvmMtahvtL1/pxoxsTRedhKq6zrzCfT8qfh3C1w==</SignatureValue>\\r\\n </Signature>\\r\\n</Receipt>\\r\\n\"\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"status": "OK",
"data": {
"Fulfillments": [
{
"FulfilledItems": [
{
"ItemId": "shield_level_5",
"ItemInstanceId": "A1437F80BE99D3E8",
"ItemClass": "shields",
"PurchaseDate": "2019-03-07T00:00:00",
"Expiration": "2020-10-01T00:00:00",
"RemainingUses": 10,
"CatalogVersion": "5"
}
]
}
]
}
}{
"code": 123,
"errorCode": 123,
"status": "<string>",
"error": "<string>",
"errorMessage": "<string>",
"errorDetails": {}
}